filtron / MarkovKernels.jl

Marginal distributions and Markov kernels that play nice with each other for the purpose of Bayesian state estimation.
MIT License
17 stars 2 forks source link

PSDTrait #112

Open filtron opened 2 months ago

filtron commented 2 months ago

Fixes #106

PSDParametrizations

New types:

abstract type PSDTrait end
struct IsPSDParametrization <: PSDTrait end
struct IsNotPSDParametrization <: PSDTrait end

For any custom MyPSDType to be considered a parametrization of a PSD matrix, it needs to implement

ispsdparametrization(::MyPSDType) = IsNotPSDParametrization()
psdparametrization(::Type{T}, P::MyPSDType) = psdparametrization(T, P) # converts the eltype of P into T

and some additional things from Base such as eltype.

Constructing Normal distributions and kernels

Sampling from Normal distributions

Marginalization

For marginalization to work the following needs to be implemented:

stein(P::MyPSDType, A::AbstractMatrix) # A * P * A'
stein(P::MyPSDType, A::AbstractMatrix, Q::SomeOtherPSDType) # A * P * A' +Q 

Conditioning

For conditioning to work the following needs to be implemented:

schur_reduce(Π::MyPSDType, C::AbstractMatrix) # returns marginal measurement cov, kalman gain, conditional cov
schur_reduce(Π::MyPSDType, C::AbstractMatrix, R::SomeOtherPSDType) # same as above but with measurement noise

Additional details

TODO