generateSSmodel: Generate (univariate) state space model matrices.

Description Usage Arguments Value Examples

Description

This function generates all necessary matrices for various types of univariate structural state space models. Not particularly useful on its own, it serves as input for the fkf function.

Usage

1
2
generateSSmodel(trendModel, seasonalModel = "none", cycleModel = "none",
  parmlist = parmList())

Arguments

trendModel

The name of a specific trend type. Options are LocalLevel, LocalLinTrend, SmoothSlope, ConstantSlope, and IntRandWalk. Input should be a quoted string. This updates the parmlist to reflect the specific trend choice. Any other string simply applies trendModelArb to the parmlist.

seasonalModel

The name of a seasonal type, either trigSeasonal or unstrucSeasonal. The default is 'none'.

cycleModel

The name of a cycle type, either tvarCycle or constCycle. The default is 'none'.

parmlist

A list of parameters. Likely the output of the function parmList. These will be used to parameterize the model matrices.

Value

A list of components

dt A matrix giving the intercept of the transition equation.
ct A matrix giving the intercept of the measurement equation.
Tt An array giving the factor of the transition equation.
Zt An array giving the factor of the measurement equation.
HHt An array giving the variance of the innovations of the transition equation.
GGt An array giving the variance of the disturbances of the measurement equation.
parmlist The parameters used to generate the model (may modify the input).

Examples

1
2
3
4
5
6
7
8
ssMod = generateSSmodel('LocalLinTrend',cycleModel = 'tvarCycle',
   parmlist=parmList(sig2xi=.5,sig2eta=.1))
simOut = simSS(250, ssMod)
plot(1:250,simOut$y,ty='l',lwd=2)
## Plot the trend
lines(1:250,c(1,1)%*%simOut$a[1:2,],col=2)
lines(1:250,c(1,1)%*%simOut$a[3:4,]+ #the cycle added to the trend
   c(1,1)%*%simOut$a[1:2,],col=4)

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