Composition

Given Markov kernels $k_2(y,z)$ and $k_1(z,x)$, composition is a binary operator producing a third kernel $k_3(y,x)$ according to

\[k_3(y,x) = \int k_2(y,x) k_1(z,x) \mathrm{d} z.\]

MarkovKernels.composeMethod
compose(K2::AbstractMarkovKernel, K1::AbstractMarkovKernel)

Computes K3, the composition of K2 ∘ K1 i.e.,

K3(y,x) = ∫ K2(y,z) K1(z,x) dz.

See also

source
Base.:∘Method
∘(K2::AbstractMarkovKernel, K1::AbstractMarkovKernel)

Computes K3, the composition of K2 ∘ K1 i.e.,

K3(y,x) = ∫ K2(y,z) K1(z,x) dz.

See also compose

source

Additionally, given likelihoods $l_1(x)$ and $l_2(x)$, composition is a binary operator producing a third likelihood $l_3(x)$ according to

\[l_3(x) = l_2(x) l_1(x).\]

MarkovKernels.composeMethod
compose(L2::AbstractLikelihood, L1::AbstractLiklelihood)

Computes L3, the composition of L2 ∘ L1 i.e.,

L3(x) = L1(x) * L2(x)

See also

source
Base.:∘Method
∘(K2::AbstractLikelihood, K1::AbstractLikelihood)

Computes L3, the composition of L2 ∘ L1 i.e.,

L3(x) = L1(x) * L2(x)

See also compose

source

Algebra

Base.:+Method

+(v::AbstractNumOrVec, D::AbstractDistribution) +(D::AbstractDistribution, v::AbstractNumOrVec)

Computes a translation of D by v, i.e. if x ∼ D then x + v ∼ D + v.

source
Base.:-Method

-(D::AbstractDistribution)

Computes the image distribution of D under negation, i.e. if x ∼ D then -x ∼ -D.

source
Base.:-Method

-(v::AbstractNumOrVec, D::AbstractDistribution)

Equivalent to +(v, -D).

-(D::AbstractDistribution, v::AbstractNumOrVec)

Equivalent to +(D, -v).

source
Base.:*Method
*(C, D::AbstractDistribution)

Equivalent to marginalize(D, DiracKernel(LinearMap(C))).

source

Marginalization

Given a distribution $\pi(x)$ and a Markov kernel $k(y,x)$, marginalization is a binary operator producing a new distriubution $p(y)$ according to

\[p(y) = \int k(y, x) \pi(x) \mathrm{d} x.\]

MarkovKernels.marginalizeMethod
marginalise(D::AbstractDistribution, K::AbstractMarkovKernel)

Computes M, the marginalization of K with respect to D, i.e.,

M(y) = ∫ K(y,x)D(x) dx

source

Bayes' rule & invert

Given a distribution $\pi(x)$ and a Markov kernel $k(y,x)$, invert is a binary operator producing a new distribution $m(y)$ and a new Markov kernel $p(x , y)$ according to

\[\pi(x) k(y,x) = m(y) p(x,y).\]

The related binary operator, Bayes' rule also evalautes the output of invert at some measurement $y$. That is, given a measurmeent $y$, $m$ evaluated at $y$ is the marginal likelihood and $p$ evaluated at $y$ is the conditional distribution of $x$ given $y$.

MarkovKernels.invertMethod

invert(D::AbstractDistribution, K::AbstractMarkovKernel)

Computes a new distribution and Markov kernel such that

Dout(y) = ∫ K(y, x) D(x) dx, and Kout(x, y) = K(y, x) * D(x) / Dout(y)

source
MarkovKernels.posterior_and_loglikeMethod
posterior_and_loglike(D::AbstractDistribution, K::AbstractMarkovKernel, y)

Computes the conditional distribution C and the marginal log-likelihood ℓ associated with the prior distribution D, measurement kernel K, and measurement y.

source
MarkovKernels.posterior_and_loglikeMethod
posterior_and_loglike(D::AbstractDistribution, L::AbstractLikelihood)

Computes the conditional distribution C and the marginal log-likelihood ℓ associated with the prior distribution D and the likelihood L.

source
MarkovKernels.posteriorMethod
posterior(D::AbstractDistribution, K::AbstractMarkovKernel, y)

Computes the conditional distribution C associated with the prior distribution D, measurement kernel K, and measurement y.

source
MarkovKernels.posteriorMethod
posterior(D::AbstractDistribution, L::AbstractLikelihood)

Computes the conditional distribution C associated with the prior distribution D and the likelihood L.

source

Doob's h-transform

Given a Markov kernel $k(y, x)$ and a likelihood function $h(y)$, computes a new Markov kernel $f(y, x)$ and new likelihood function

MarkovKernels.htransformMethod
htransform(K::AbstractMarkov, L::AbstractLikelihood)

Computes a Markov kernel Kout and Likelihood Lout such that

Lout(z) = ∫ L(x) K(x, z) dx, and Kout(x, z) = L(x) K(x, z) / Lout(z)

source