bayespy.inference.vmp.nodes.categorical_markov_chain.CategoricalMarkovChainDistribution

class bayespy.inference.vmp.nodes.categorical_markov_chain.CategoricalMarkovChainDistribution(categories, states)[source]

Class for the VMP formulas of categorical Markov chain variables.

__init__(categories, states)[source]

Create VMP formula node for a categorical variable

categories is the total number of categories. states is the length of the chain.

Methods

__init__(categories, states)

Create VMP formula node for a categorical variable

compute_cgf_from_parents(u_p0, u_P)

Compute \mathrm{E}_{q(p)}[g(p)]

compute_fixed_moments_and_f(x[, mask])

Compute the moments and f(x) for a fixed value.

compute_gradient(g, u, phi)

Compute the standard gradient with respect to the natural parameters.

compute_logpdf(u, phi, g, f, ndims)

Compute E[log p(X)] given E[u], E[phi], E[g] and E[f].

compute_message_to_parent(parent, index, u, ...)

Compute the message to a parent node.

compute_moments_and_cgf(phi[, mask])

Compute the moments and g(\phi).

compute_phi_from_parents(u_p0, u_P[, mask])

Compute the natural parameter vector given parent moments.

compute_weights_to_parent(index, weights)

Maps the mask to the plates of a parent.

plates_from_parent(index, plates)

Resolve the plate mapping from a parent.

plates_to_parent(index, plates)

Resolves the plate mapping to a parent.

random(*phi[, plates])

Draw a random sample from the distribution.

squeeze(axis)

Squeeze a plate axis from the distribution