# TransportMaps.Algorithms.SequentialInference.LinearSequentialInference¶

## Module Contents¶

### Classes¶

 LinearFilter Perform the on-line filtering of a sequential linear Gaussian Hidden Markov chain. LinearSmoother Perform the on-line assimilation of a sequential linear Gaussian Hidden Markov chain.
class TransportMaps.Algorithms.SequentialInference.LinearSequentialInference.LinearFilter(ders=0, pi_hyper=None)[source]

Perform the on-line filtering of a sequential linear Gaussian Hidden Markov chain.

Aka: Kalman filter.

If the linear state-space model is parametric, i.e.

$\begin{split}{\bf Z}_{k+1} = {\bf c}_k(\theta) + {\bf F}_k(\theta){\bf Z}_k + {\bf w}_k(\theta) \\ {\bf Y}_{k} = {\bf H}_k(\theta){\bf Z}_k + {\bf v}_k(\theta)\end{split}$

then one can optionally compute the gradient (with respect to the parameters) of the filter.

Parameters:
• ders (int) – 0 no gradient is computed, 1 compute gradient

• pi_hyper (Distribution) – prior distribution on the hyper-parameters $$\pi(\Theta)$$

Todo

Square-root filter

property marginal_log_likelihood[source]

Returns the marginal log-likelihood $$\log\pi\left({\bf Y}_{\Xi\leq k}\right)$$

Returns:

(float) – current marginal likelihood

property filtering_mean_list[source]

Returns the means of all the filtering distributions

Returns:

(list of float) – means of

$$\pi\left({\bf Z}_k\middle\vert{\bf Y}_{\Xi\leq k}\right)$$ for $$k\in \Lambda=0,\ldots,n$$.

property filtering_covariance_list[source]

Returns the covariances of all the filtering distributions

Returns:

(list of ndarray) – covariances of

$$\pi\left({\bf Z}_k\middle\vert{\bf Y}_{\Xi\leq k}\right)$$ for $$k\in \Lambda=0,\ldots,n$$.

property grad_marginal_log_likelihood[source]

Returns the gradient of the marginal log-likelihood $$\nabla_\theta\log\pi\left({\bf Y}_{\Xi\leq k}\right)$$

Returns:

(float) – current marginal likelihood

property filtering_grad_mean_list[source]

Returns the gradient of the means of all the filtering distributions

Returns:

(list of float) – gradient of the means of

$$\pi\left({\bf Z}_k\middle\vert{\bf Y}_{\Xi\leq k}\right)$$ for $$k\in \Lambda=0,\ldots,n$$.

property filtering_grad_covariance_list[source]

Returns the gradient of the covariances of all the filtering distributions

Returns:

(list of ndarray) –

gradient of the covariances of $$\pi\left({\bf Z}_k\middle\vert{\bf Y}_{\Xi\leq k}\right)$$ for $$k\in \Lambda=0,\ldots,n$$.

_assimilation_step()[source]

Assimilate one piece of Gaussian data $$\left( \pi\left({\bf Z}_{k+1} \middle\vert {\bf Z}_k \right), \log \mathcal{L}\left({\bf y}_{k+1}\middle\vert {\bf Z}_{k+1}\right) \right)$$.

class TransportMaps.Algorithms.SequentialInference.LinearSequentialInference.LinearSmoother(lag=None)[source]

Perform the on-line assimilation of a sequential linear Gaussian Hidden Markov chain.

Parameters:

lag (numpy.float) – lag to be used in the backward updates of smoothing means and covariances. The default value None indicates infinite lag.

Todo

no hyper-parameter admitted right now.

property lag[source]
property smoothing_mean_list[source]
property smoothing_covariance_list[source]
_assimilation_step()[source]

Assimilate one piece of Gaussian data $$\left( \pi\left({\bf Z}_{k+1} \middle\vert {\bf Z}_k \right), \log \mathcal{L}\left({\bf y}_{k+1}\middle\vert {\bf Z}_{k+1}\right) \right)$$.

_update_smoothing_mean_covariance_lists(nsteps, lag, smooth_mean_list, smooth_cov_list, CB_queue, CB2_queue, c, C, a=None, A=None, B=None)[source]
offline_smoothing_mean_covariance_lists(lag=None)[source]

Compute the mean and covariances with a fixed lag for a pre-assimilated density