Learn R Programming

KFAS (version 1.0.3)

simulateSSM: Simulation of a gaussian State Space Model

Description

Function simulateSMM simulates states, signals, disturbances or missing observations of the gaussian state space model.

Usage

simulateSSM(object, type = c("states", "signals", "disturbances",
  "observations", "epsilon", "eta"), filtered = FALSE, nsim = 1,
  antithetics = FALSE, conditional = TRUE)

Arguments

object
gaussian state space object.
type
What to simulate.
filtered
Simulate from $p(\alpha_t|y_{t-1},...,y_1)$ instead of $p(\alpha|y)$.
nsim
Number of independent samples. Default is 1.
antithetics
Use antithetic variables in simulation. Default is FALSE.
conditional
Simulations are conditional to data. If FALSE, the initial state $\alpha_1$ is set to $\hat \alpha_1$ computed by KFS, and all the observations are removed from the model. Default is TRUE.

Value

  • An n x k x nsim array containing the simulated series, where k is number of observations, signals, states or disturbances.

Details

Simulation smoother algorithm is based to article by J. Durbin and S.J. Koopman (2002). Function can use two antithetic variables, one for location and other for scale, so output contains four blocks of simulated values which correlate which each other (ith block correlates negatively with (i+1)th block, and positively with (i+2)th block etc.).

References

Durbin J. and Koopman, S.J. (2002). A simple and efficient simulation smoother for state space time series analysis, Biometrika, Volume 89, Issue 3