ffbs {spate}R Documentation

Forward Filtering Backward Sampling algorithm.

Description

Forward Filtering Backward Sampling algorithm for sampling from the joint full conditional of the hidden state of a linear, Gaussian state space model. To be more specific, one samples from P[α.]P[\alpha|.] where α\alpha is specified through

yt=lpt+Hxit+nut,νt N(0,Ω)y_t = lp_t + H xi_t + nu_t, \nu_t ~ N(0,\Omega)

and

αt=Gαt1+ϵt,ϵt N(0,Σ).\alpha_t = G \alpha_{t-1} + \epsilon_t, \epsilon_t ~ N(0,\Sigma).

Usage

ffbs(y, lp, G, Sigma, H, Omega, N = dim(y)[2],T = dim(y)[1],
      NF = dim(G)[1], lglk = FALSE, BwSp = TRUE, filt = FALSE)

Arguments

y

Observed data in an T x N matrix with columns and rows corresponding to time and space, respectively.

lp

Mean (linear predictor) in an T x N matrix with columns and rows corresponding to time and space, respectively.

G

Propagator matrix of the latent process α\alpha.

Sigma

Innovation covariance matrix of the latent process α\alpha.

H

Observation matrix relating y to α\alpha.

Omega

Covariance matrix of the observation error ν\nu.

N

Number of points in space.

T

Number of points in time.

NF

Dimension of the latent process α\alpha.

lglk

Logical; if 'TRUE' the value of the log-likelihood is returned as well.

BwSp

Logical; if 'TRUE' a sample from the full conditional of α\alpha is returned.

filt

Logical; if 'TRUE' the filtered values for α\alpha are returned.

Details

In the context of the SPDE, α\alpha are the Fourier coefficients.

Value

A list with entries (depending on whether 'lglk', 'BwSp', 'filt' are 'TRUE' or 'FALSE'):

simAlpha

A T x N matrix with a sample from the full conditional of latent process α\alpha,

ll

The evaluated log-likelihood,

mtt

A T x N matrix with the mean of the full conditional of latent process α\alpha.

Author(s)

Fabio Sigrist


[Package spate version 1.7.5 Index]