ChainModels.KChainModelType
KChainModel{T,L} <: DiscreteMultivariateDistribution

A type to represent a discrete multivariate probability distribution factorized on a one-dimensional chain of length L.

FIELDS

  • f a vector containing the factors as arrays
source
ChainModels.accumulate_middleMethod
accumulate_middle(f::Vector{Matrix{T}}) where {T<:Real}

Compute the middle partial normalization for the matrices in f

\[m_{i,j}(x_i,x_j) = \log\sum\limits_{x_{i+1},\ldots,x_{j-1}}\prod\limits_{k=i}^{j-1} e^{f_k(x_k,x_{k+1})}\]

source
ChainModels.lognormalizationMethod
lognormalization(chain::ChainModel; l = accumulate_left(chain))

Conceptually equivalent to log(normalization(chain)), less prone to numerical issues

source
ChainModels.nstatesMethod
nstates(f::AbstractVector{<:AbstractArray{<:Real}})

Returns an iterator with the number of values each variable can take.

source
ChainModels.rand_kchain_modelMethod
rand_kchain_model([rng], K::Integer, L::Integer, q::Integer)

Return a KChainModel of length L and q states for each variable, with random entries

source