pymc.Normal#

class pymc.Normal(name, *args, rng=None, dims=None, initval=None, observed=None, total_size=None, transform=UNSET, **kwargs)[source]#

Univariate normal log-likelihood.

The pdf of this distribution is

\[f(x \mid \mu, \tau) = \sqrt{\frac{\tau}{2\pi}} \exp\left\{ -\frac{\tau}{2} (x-\mu)^2 \right\}\]

Normal distribution can be parameterized either in terms of precision or standard deviation. The link between the two parametrizations is given by

\[\tau = \dfrac{1}{\sigma^2}\]

(Source code, png, hires.png, pdf)

../../../_images/pymc-Normal-1.png

Support

\(x \in \mathbb{R}\)

Mean

\(\mu\)

Variance

\(\dfrac{1}{\tau}\) or \(\sigma^2\)

Parameters
mutensor_like of float, default 0

Mean.

sigmatensor_like of float, optional

Standard deviation (sigma > 0) (only required if tau is not specified). Defaults to 1 if neither sigma nor tau is specified.

tautensor_like of float, optional

Precision (tau > 0) (only required if sigma is not specified).

Examples

with pm.Model():
    x = pm.Normal('x', mu=0, sigma=10)

with pm.Model():
    x = pm.Normal('x', mu=0, tau=1/23)

Methods

Normal.__init__(*args, **kwargs)

Normal.dist([mu, sigma, tau, no_assert])

Creates a tensor variable corresponding to the cls distribution.

Normal.logcdf(mu, sigma)

Compute the log of the cumulative distribution function for Normal distribution at the specified value.

Normal.moment(size, mu, sigma)

Attributes

rv_class

rv_op