Description Usage Arguments Value Examples
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.
1 2 | generateSSmodel(trendModel, seasonalModel = "none", cycleModel = "none",
parmlist = parmList())
|
trendModel |
The name of a specific trend type. Options are
|
seasonalModel |
The name of a seasonal type, either |
cycleModel |
The name of a cycle type, either |
parmlist |
A list of parameters. Likely the output of the function
|
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).
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.