GaussianPrior#

class pypillometry.signal.gaussmarkov.GaussianPrior(mean, cov, names=None, label='')[source]#

Bases: object

Gaussian prior of the parameter vector of a TimescaleBank.

Attributes:
mean(p,) array
cov(p, p) array

covariance (a vector of standard deviations is turned into a diagonal covariance)

nameslist of str

names of the parameters (see TimescaleBank.names)

labelstr

description, e.g. "general (medium)"

Examples

>>> prior = GaussianPrior([0., 1.], [1., 2.], names=["a", "b"])
>>> prior.sd
array([1., 2.])
>>> float(prior.logpdf([0., 3.]))
-0.5

Methods

logpdf

log density at theta up to a constant, -(theta - mean)' cov^-1 (theta - mean) / 2

scaled

copy with all standard deviations multiplied by factor

Details

logpdf(theta)[source]#

log density at theta up to a constant, -(theta - mean)' cov^-1 (theta - mean) / 2

Return type:

float

scaled(factor, label=None)[source]#

copy with all standard deviations multiplied by factor

Return type:

GaussianPrior

property precision: ndarray#

inverse of the covariance

property sd: ndarray#

standard deviations (square roots of the diagonal of cov)