ucm creates an S3 object representing an UC model:
ucm(
z,
bc = FALSE,
uc = NULL,
xreg = NULL,
cform = TRUE,
fit = TRUE,
s = 12,
...
)An object of class ucm and class ssm.
an object of class ts.
logical. If TRUE, logs are taken.
list of objects of class uc or a character with
the name of a predefined model: "llm" local linear model, "lltm" local
linear trend model, "bsm" basic structural model, "bsmd" basic structural
model with dummy seasonality.
optional design matrix of regressors.
logical. If TRUE, observation equation is given in contemporaneous form (j = 0); otherwise it is written in lagged form (j = 1).
logical. If TRUE, model is fitted.
integer, seasonal period. Optional argument to create a UC model without providing a time series.
additional parameters for the fit.ssm function.
z(t) = b'*x(t) + T(t - j) + S(t - j) + C(t - j) + AR(t - j) + I(t),
where z(t) is a time series; x(t) is a set of regressors; T(t - j), S(t - j),
C(t - j), AR(t - j) and I(t) are the trend, seasonal, cycle, autoregressive
and irregular unobserved components; and i indicates whether the model is
written in lagged form (j = 1) or contemporaneous form (j = 0).
See uc and ssm for more details.
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
ucm1 <- ucm(Nile, uc = "llm")
ucm1
Run the code above in your browser using DataLab