# bayespy.nodes.VaryingGaussianMarkovChain¶

class bayespy.nodes.VaryingGaussianMarkovChain(mu, Lambda, B, S, nu, n=None, **kwargs)[source]

Node for Gaussian Markov chain random variables with time-varying dynamics.

The node models a sequence of Gaussian variables with linear Markovian dynamics. The time variability of the dynamics is obtained by modelling the state dynamics matrix as a linear combination of a set of matrices with time-varying linear combination weights. The graphical model can be presented as:

where and are the mean and the precision matrix of the initial state, is the precision of the innovation noise, and are the state dynamics matrix obtained by mixing matrices with weights .

The probability distribution is

where

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

, mean of , -dimensional with plates (…)

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

, precision matrix of , -dimensional with plates (…)

BGaussian-like node or (…,D,D,K)-array

, a set of state dynamics matrix, -dimensional with plates (…,D)

SGaussian-like node or (…,N-1,K)-array

, time-varying weights of the linear combination, -dimensional with plates (…,N-1)

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

, diagonal elements of the precision of the innovation process, plates (…,D)

nint, optional

, the length of the chain. Must be given if does not have plates over the time domain (which would not make sense).

Notes

Equivalent model block can be constructed with GaussianMarkovChain by explicitly using SumMultiply to compute the linear combination. However, that approach is not very efficient for large datasets because it does not utilize the structure of , thus it explicitly computes huge moment arrays.

References

[8]

__init__(mu, Lambda, B, S, nu, n=None, **kwargs)[source]

Create VaryingGaussianMarkovChain node.

Methods

 __init__(mu, Lambda, B, S, nu[, n]) Create VaryingGaussianMarkovChain node. add_plate_axis(to_plate) broadcasting_multiplier(plates, *args) Delete this node and the children Computes gradient with respect to the natural parameters. Return parameters of the VB distribution. Computes the Riemannian/natural gradient. get_shape(ind) Return True if the node has a plotter 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) ] 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. save(filename) Set the parameters of the VB distribution. set_plotter(plotter) Print the distribution using standard parameterization. update([annealing])

Attributes

 dims plates plates_multiplier Plate multiplier is applied to messages to parents