Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(56)  |  Call(32)  |  Derive(0)  |  Import(24)

src/a/s/astroML-0.2/book_figures/chapter5/fig_poisson_likelihood.py   astroML(Download)
from scipy import stats, interpolate
from astroML.stats.random import linear
from astroML.plotting.mcmc import convert_to_stdev
 
#----------------------------------------------------------------------
    ax = fig.add_subplot(2, 2, 2 + 2 * num)
 
    ax.contour(a, b, convert_to_stdev(LP),
               levels=(0.683, 0.955, 0.997),
               colors='k', linewidths=2)
 
    ax.contour(a, b, convert_to_stdev(LG),

src/a/s/astroML-0.2/book_figures/chapter5/fig_outlier_likelihood.py   astroML(Download)
from matplotlib import pyplot as plt
from scipy.stats import norm
from astroML.plotting.mcmc import convert_to_stdev
 
#----------------------------------------------------------------------
ax1.imshow(L1.T, origin='lower', aspect='auto', cmap=plt.cm.binary,
           extent=[mu[0], mu[-1], g1[0], g1[-1]])
ax1.contour(mu, g1, convert_to_stdev(np.log(L1).T),
            levels=(0.683, 0.955, 0.997),
            colors='k')
ax2.imshow(L2.T, origin='lower', aspect='auto', cmap=plt.cm.binary,
           extent=[mu[0], mu[-1], g1[0], g1[-1]])
ax2.contour(mu, g1, convert_to_stdev(np.log(L2).T),
            levels=(0.683, 0.955, 0.997),
            colors='k')

src/a/s/astroML-0.2/book_figures/chapter5/fig_cauchy_mcmc.py   astroML(Download)
from scipy.stats import cauchy
from matplotlib import pyplot as plt
from astroML.plotting.mcmc import convert_to_stdev
 
# this fixes a problem when using older versions of pymc with newer
ax1.yaxis.set_major_formatter(plt.NullFormatter())
 
ax1.contour(mu, gamma, convert_to_stdev(logL),
            levels=(0.683, 0.955, 0.997),
            colors='b', linestyles='dashed')
 
ax1.contour(0.5 * (mu_bins[:-1] + mu_bins[1:]),
            0.5 * (gamma_bins[:-1] + gamma_bins[1:]),
            convert_to_stdev(np.log(L_MCMC.T)),

src/a/s/astroML-HEAD/book_figures/chapter5/fig_poisson_likelihood.py   astroML(Download)
from scipy import stats, interpolate
from astroML.stats.random import linear
from astroML.plotting.mcmc import convert_to_stdev
 
#----------------------------------------------------------------------
    ax = fig.add_subplot(2, 2, 2 + 2 * num)
 
    ax.contour(a, b, convert_to_stdev(LP),
               levels=(0.683, 0.955, 0.997),
               colors='k', linewidths=2)
 
    ax.contour(a, b, convert_to_stdev(LG),

src/a/s/astroML-HEAD/book_figures/chapter5/fig_outlier_likelihood.py   astroML(Download)
from matplotlib import pyplot as plt
from scipy.stats import norm
from astroML.plotting.mcmc import convert_to_stdev
 
#----------------------------------------------------------------------
ax1.imshow(L1.T, origin='lower', aspect='auto', cmap=plt.cm.binary,
           extent=[mu[0], mu[-1], g1[0], g1[-1]])
ax1.contour(mu, g1, convert_to_stdev(np.log(L1).T),
            levels=(0.683, 0.955, 0.997),
            colors='k')
ax2.imshow(L2.T, origin='lower', aspect='auto', cmap=plt.cm.binary,
           extent=[mu[0], mu[-1], g1[0], g1[-1]])
ax2.contour(mu, g1, convert_to_stdev(np.log(L2).T),
            levels=(0.683, 0.955, 0.997),
            colors='k')

src/a/s/astroML-HEAD/book_figures/chapter5/fig_cauchy_mcmc.py   astroML(Download)
from scipy.stats import cauchy
from matplotlib import pyplot as plt
from astroML.plotting.mcmc import convert_to_stdev
 
# this fixes a problem when using older versions of pymc with newer
ax1.yaxis.set_major_formatter(plt.NullFormatter())
 
ax1.contour(mu, gamma, convert_to_stdev(logL),
            levels=(0.683, 0.955, 0.997),
            colors='b', linestyles='dashed')
 
ax1.contour(0.5 * (mu_bins[:-1] + mu_bins[1:]),
            0.5 * (gamma_bins[:-1] + gamma_bins[1:]),
            convert_to_stdev(np.log(L_MCMC.T)),

src/a/s/astroML-0.2/book_figures/chapter8/fig_linreg_inline.py   astroML(Download)
import numpy as np
from matplotlib import pyplot as plt
from astroML.plotting.mcmc import convert_to_stdev
 
#----------------------------------------------------------------------
b_range = np.linspace(-1, 1, 80)
logL = -((a_range[:, None, None] * x + b_range[None, :, None] - y) / dy) ** 2
sigma = [convert_to_stdev(logL[:, :, i]) for i in range(3)]
 
# compute best-fit from first three points
        logL_together[mask] = -np.inf
 
    sigma_together = convert_to_stdev(logL_together)
 
    ax.contour(a_range, b_range, sigma_together.T,

src/a/s/astroML-HEAD/book_figures/chapter8/fig_linreg_inline.py   astroML(Download)
import numpy as np
from matplotlib import pyplot as plt
from astroML.plotting.mcmc import convert_to_stdev
 
#----------------------------------------------------------------------
b_range = np.linspace(-1, 1, 80)
logL = -((a_range[:, None, None] * x + b_range[None, :, None] - y) / dy) ** 2
sigma = [convert_to_stdev(logL[:, :, i]) for i in range(3)]
 
# compute best-fit from first three points
        logL_together[mask] = -np.inf
 
    sigma_together = convert_to_stdev(logL_together)
 
    ax.contour(a_range, b_range, sigma_together.T,

src/a/s/astroML-0.2/book_figures/chapter8/fig_total_least_squares.py   astroML(Download)
 
from astroML.linear_model import TLS_logL
from astroML.plotting.mcmc import convert_to_stdev
from astroML.datasets import fetch_hogg2010test
 
        logL[i, j] = TLS_logL(get_beta(m[i], b[j]), X, dX)
 
ax.contour(m, b, convert_to_stdev(logL.T),
           levels=(0.683, 0.955, 0.997),
           colors='k')

src/a/s/astroML-0.2/book_figures/chapter8/fig_outlier_rejection.py   astroML(Download)
from matplotlib import pyplot as plt
from astroML.datasets import fetch_hogg2010test
from astroML.plotting.mcmc import convert_to_stdev
 
# Hack to fix import issue in older versions of pymc
    H, xbins, ybins = np.histogram2d(trace[:, 1], trace[:, 0], bins=bins[i])
    H[H == 0] = 1E-16
    Nsigma = convert_to_stdev(np.log(H))
 
    ax.contour(0.5 * (xbins[1:] + xbins[:-1]),

  1 | 2 | 3  Next