stsm | R Documentation |
stsm
creates an S3 object representing a time-invariant structural
time series model:
stsm(y, b, C, S, xreg = NULL, bc = FALSE, cform = TRUE)
y |
an object of class |
b |
vector of constants. |
C |
matrix of constants. |
S |
covariance matrix of the error vector (u_t, v_t). |
xreg |
matrix of regressors. |
bc |
logical. If TRUE logs are taken. |
cform |
logical. If TRUE station equation is given in contemporaneous form, otherwise it is written in future form. |
y(t) = b'x(t) + u(t) (observation equation), x(t+j) = Cx(t+j-1) + v(t) (state equation), j = 0 for contemporaneous form or 1 for future form.
An object of class stsm
.
Durbin, J. and Koopman, S.J. (2012) Time Series Analysis by State Space Methods, 2nd ed., Oxford University Press, Oxford.
Harvey, A.C. (1989) Forecasting, Structural Time Series Models and the Kalman Filter. Cambridge University Press, Cambridge.
# Local level model
b <- 1
C <- as.matrix(1)
stsm1 <- stsm(Nile, b, C, S = diag(c(irr = 1, lvl = 0.5)) )
stsm1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.