bayespy.nodes.GaussianMarkovChain

class bayespy.nodes.GaussianMarkovChain(mu, Lambda, A, nu, n=None, inputs=None, **kwargs)[source]

Node for Gaussian Markov chain random variables.

In a simple case, the graphical model can be presented as:

Figure made with TikZ

where \boldsymbol{\mu} and \mathbf{\Lambda} are the mean and the precision matrix of the initial state, \mathbf{A} is the state dynamics matrix and \boldsymbol{\nu} is the precision of the innovation noise. It is possible that \mathbf{A} and/or \boldsymbol{\nu} are different for each transition instead of being constant.

The probability distribution is

p(\mathbf{x}_0, \ldots, \mathbf{x}_{N-1}) = p(\mathbf{x}_0)
\prod^{N-1}_{n=1} p(\mathbf{x}_n | \mathbf{x}_{n-1})

where

p(\mathbf{x}_0) &= \mathcal{N}(\mathbf{x}_0 | \boldsymbol{\mu}, \mathbf{\Lambda})
\\
p(\mathbf{x}_n|\mathbf{x}_{n-1}) &= \mathcal{N}(\mathbf{x}_n |
\mathbf{A}_{n-1}\mathbf{x}_{n-1}, \mathrm{diag}(\boldsymbol{\nu}_{n-1})).

Parameters
muGaussian-like node or (…,D)-array

\boldsymbol{\mu}, mean of x_0, D-dimensional with plates (…)

LambdaWishart-like node or (…,D,D)-array

\mathbf{\Lambda}, precision matrix of x_0, D\times D -dimensional with plates (…)

AGaussian-like node or (D,D)-array or (…,1,D,D)-array or (…,N-1,D,D)-array

\mathbf{A}, state dynamics matrix, D-dimensional with plates (D,) or (…,1,D) or (…,N-1,D)

nugamma-like node or (D,)-array or (…,1,D)-array or (…,N-1,D)-array

\boldsymbol{\nu}, diagonal elements of the precision of the innovation process, plates (D,) or (…,1,D) or (…,N-1,D)

nint, optional

N, the length of the chain. Must be given if \mathbf{A} and \boldsymbol{\nu} are constant over time.

__init__(mu, Lambda, A, nu, n=None, inputs=None, **kwargs)[source]

Create GaussianMarkovChain node.

Methods

__init__(mu, Lambda, A, nu[, n, inputs])

Create GaussianMarkovChain node.

add_plate_axis(to_plate)

broadcasting_multiplier(plates, *args)

delete()

Delete this node and the children

get_gradient(rg)

Computes gradient with respect to the natural parameters.

get_mask()

get_moments()

get_parameters()

Return parameters of the VB distribution.

get_pdf_nodes()

get_riemannian_gradient()

Computes the Riemannian/natural gradient.

get_shape(ind)

has_plotter()

Return True if the node has a plotter

initialize_from_parameters(*args)

initialize_from_prior()

initialize_from_random()

Set the variable to a random sample from the current distribution.

initialize_from_value(x, *args)

load(filename)

logpdf(X[, mask])

Compute the log probability density function Q(X) of this node.

lower_bound_contribution([gradient, …])

Compute E[ log p(X|parents) - log q(X) ]

lowerbound()

move_plates(from_plate, to_plate)

observe(x, *args[, mask])

Fix moments, compute f and propagate mask.

pdf(X[, mask])

Compute the probability density function of this node.

plot([fig])

Plot the node distribution using the plotter of the node

random(*phi[, plates])

Draw a random sample from the distribution.

rotate(R[, inv, logdet])

save(filename)

set_parameters(x)

Set the parameters of the VB distribution.

set_plotter(plotter)

show()

Print the distribution using standard parameterization.

unobserve()

update([annealing])

Attributes

dims

plates

plates_multiplier

Plate multiplier is applied to messages to parents