e# Library Reference

Systems

AlgebraicInference.CanonicalFormType
CanonicalForm{T₁, T₂} = GaussianSystem{
    T₁,
    ZerosMatrix{Bool, Tuple{OneTo{Int}, OneTo{Int}}},
    T₂,
    ZerosVector{Bool, Tuple{OneTo{Int}}},
    Bool}

A canonical form.

source
AlgebraicInference.GaussianSystemMethod
GaussianSystem(
    P::AbstractMatrix,
    S::AbstractMatrix,
    p::AbstractVector,
    s::AbstractVector,
    σ::Real)

Construct a Gaussian system by specifying its energy function. You should set

σ  = dot(s, pinv(S) * s)
source
AlgebraicInference.CanonicalFormMethod
CanonicalForm(K::AbstractMatrix, h::AbstractVector)

Construct the canonical form

\[\mathcal{C}(K, h, g),\]

where the normalization constant $g$ is inferred from $K$ and $h$.

source
AlgebraicInference.normalFunction
normal(μ::AbstractVector, Σ::AbstractMatrix)

Construct a multivariate normal distribution with mean vector μ and covariance matrix Σ.

source
normal(μ::Real, σ::Real)

Construct a normal distribution with mean μ and standard deviation σ.

source
AlgebraicInference.kernelFunction
kernel(L::AbstractMatrix, μ::AbstractVector, Σ::AbstractMatrix)

Construct a conditional distribution of the form

\[p(Y \mid X = x) = \mathcal{N}(Lx + \mu, \Sigma).\]

source
kernel(l::AbstractVector, μ::Real, σ::Real)

Construct a conditional distribution of the form

\[p(Y \mid X = x) = \mathcal{N}(l^\mathsf{T}x + \mu, \sigma^2).\]

source
Statistics.covMethod
cov(Σ::GaussianSystem; atol::Real=1e-8)

Get the covariance matrix of Σ.

source

Problems

AlgebraicInference.InferenceProblemMethod
InferenceProblem(
    diagram::RelationDiagram,
    hom_map::AbstractDict,
    ob_map::AbstractDict;
    hom_attr::Symbol=:name,
    ob_attr::Symbol=:junction_type,
    var_attr::Symbol=:variable
    check::Bool=true)

Construct an inference problem that performs undirected compositon.

source
CommonSolve.solveMethod
solve(
    problem::InferenceProblem,
    elimination_algorithm::EliminationAlgorithm=MinFill()
    supernode_type::SupernodeType=Node()
    architecture_type::ArchitectureType=ShenoyShafer())

Solve an inference problem. This involves several steps:

interaction graph
    ↓ elimination algorithm
elimination tree
    ↓ supernode type
join tree
    ↓ architecture type
solution

First an elimination agorithm is used to construct an elimination tree from the model's interaction graph. Then, nodes of the elimination tree are merged into supernodes, forming a join (or junction) tree. Finally, a message passing algorithm is used to compute a solution.

source
CommonSolve.initMethod
init(
    problem::InferenceProblem,
    elimination_algorithm::EliminationAlgorithm=MinFill(),
    supernode_type::SupernodeType=Node(),
    architecture_type::ArchitectureType=ShenoyShafer())

Construct a solver for an inference problem. This involves several steps:

interaction graph
    ↓ elimination algorithm
elimination tree
    ↓ supernode type
join tree

First an elimination agorithm is used to construct an elimination tree from the model's interaction graph. Then, nodes of the elimination tree are merged into supernodes, forming a join (or junction) tree.

When solve! is called on the solver, a message passing algorithm is used to compute the solution.

source

Solvers

Base.randMethod
rand(solver::InferenceSolver{AncestralSampler()})
source
Base.randMethod
rand(rng::AbstractRNG, solver::InferenceSolver{AncestralSampler()})
source

Elimination

Supernodes

Architectures