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[\alpha|.]
where
\alpha
is specified through
y_t = lp_t + H xi_t + nu_t, \nu_t ~ N(0,\Omega)
and
\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 |
Sigma |
Innovation covariance matrix of the latent process |
H |
Observation matrix relating y to |
Omega |
Covariance matrix of the observation error |
N |
Number of points in space. |
T |
Number of points in time. |
NF |
Dimension of the latent process |
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 |
filt |
Logical; if 'TRUE' the filtered values for |
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 |
ll |
The evaluated log-likelihood, |
mtt |
A T x N matrix with the mean of the full conditional of latent process |
Author(s)
Fabio Sigrist