simSS: Simulate linear state space models

Description Usage Arguments Value Examples

Description

This function simulates a time-invariant state space model. That is, the parameters are constant in time. The state space model is represented by the transition equation and the measurement equation. Let m be the dimension of the state variable, d be the dimension of the observations, and n the number of observations. The transition equation and the measurement equation are given by

a(t + 1) = d(t) + T(t) a(t) + H(t) η(t)

y(t) = c(t) + Z(t) a(t) + G(t) ε(t),

where η(t) and ε_t are iid N(0, I_m) and iid N(0, I_d), respectively, and α(t) denotes the state variable. The parameters admit the following dimensions:

Usage

1
2
3
simSS(nobs, modelMats, Tt = matrix(1), Zt = matrix(1), HHt = diag(1,
  dim(Tt)[1]), GGt = diag(1, nrow(Zt), ncol(Zt)), dt = double(dim(Tt)[1]),
  ct = double(dim(Zt)[1]))

Arguments

nobs

The desired number of timepoints.

modelMats

A list of the matrices below, likely as output from the function generateSSmodel

Tt

A matrix giving the factor of the transition equation.

Zt

A matrix giving the factor of the measurement equation.

HHt

A matrix giving the variance of the innovations of the transition equation.

GGt

A matrix giving the variance of the disturbances of the measurement equation.

dt

A matrix giving the intercept of the transition equation.

ct

A matrix giving the intercept of the measurement equation.

Value

A list with the following components:

a a matrix of the simulated states of dimension m x nsimul
y a matrix of the simulated observations of dimension d x nsimul

Examples

1
2
3
4
5
Tt = matrix(c(.9,.1,.2,.7),2)
Zt = matrix(c(1,0,.2,0,1,.8),3)
HHt = .5*diag(2)
GGt = .1*diag(3)
outSim = simSS(100, Tt=Tt, Zt=Zt, HHt=HHt, GGt=GGt)

dajmcdon/myFKF documentation built on May 3, 2019, 5:16 p.m.