MarkovKernels.jl aims to support a wide variety of parametrizations of positive semi-definite matrices. How this is accomplished is explaiend in the following.

Types

Currently, the following types are valid PSD parametrizations (in the sense, the PSDParametriszations methods below have been implemented):

Real
SelfAdjoint
Cholesky

Here, the definition of SelfAdjoint is:

const RealSymmetric{T,S} = Symmetric{T,S} where {T<:Real,S}
const ComplexHermitian{T,S} = Hermitian{T,S} where {T<:Complex,S}
const RealDiagonal{T,S} = Diagonal{T,S} where {T<:Real,S}
const SelfAdjoint{T,S} =
    Union{RealSymmetric{T,S},ComplexHermitian{T,S},RealDiagonal{T,S}} where {T,S}

PSD Trait

In order to determine, whether a type is a PSDParametrization the following types are defined:

abstract type PSDTrait end
struct IsPSD <: PSDTrait end
struct IsNotPSD <: PSDTrait end

A custom typer can opt into being a PSDparametrization by implementing

psdcheck(::MyPSDType) = IsPSD()

which is a promise that the methods of the next section have been implemented.

PSDParametrizations methods

MarkovKernels.convert_psd_eltypeMethod
convert_psd_eltype(::Type{T}, P)

Wraps P in a psd paramtrization of eltype T. If P is already a type of psd paramtrization, then just the eltype is converted.

source
MarkovKernels.schur_reduceMethod
schur_reduce(Π, C, [R])

Computes the tuple (S, K, Σ) associated with the following (block) Schur reduction:

[C*Π*C'+R C*Π; Π*C' Π] = [0 0; 0 Σ] + [I; K]*(C*Π*C' + R)*[I; K]'

In terms of Kalman filtering, Π is the predictive covariance, C the measurement matrix, and R the measurement covariance, then S is the marginal measurement covariance, K is the Kalman gain, and Σ is the filtering covariance.

source

SelfAdjoint methods

Additionally, the following methods are defined for SelfAdjoint:

MarkovKernels.selfadjoint!Method
selfadjoint!(A)

Computes the self-adjoint part of A, in-place, and wraps it in an appropriate self-adjoint wrapper type (i.e. Symemtric / Hermitian).

source
MarkovKernels.selfadjointMethod
selfadjoint(A)

Computes the self-adjoint part of A and wraps it in an appropriate self-adjoint wrapper type (i.e. Symemtric / Hermitian).

source