stsm Model Objectstsm or stsmFit returned by
functions maxlik.fd and maxlik.fd.## S3 method for class 'stsmFit':
coef(object, ...)
## S3 method for class 'stsmFit':
print(x, digits = max(3L, getOption("digits") - 3L),
vcov.type = c("hessian", "infomat", "OPG", "sandwich", "optimHessian"), ...)
## S3 method for class 'stsmFit':
fitted(object, std.rediduals = TRUE, version = c("KFKSDS", "stats"), ...)
## S3 method for class 'stsmFit':
residuals(object, standardised = FALSE, version = c("KFKSDS", "stats"), ...)
## S3 method for class 'stsmComponents':
plot(x, ...)
## S3 method for class 'stsm':
predict(object, n.ahead = 1L, se.fit = TRUE,
version = c("KFKSDS", "stats"), ...)
## S3 method for class 'stsmFit':
predict(object, n.ahead = 1L, se.fit = TRUE,
version = c("KFKSDS", "stats"), ...)
## S3 method for class 'stsmPredict':
plot(x, ...)
## S3 method for class 'stsm':
tsSmooth(object, version = c("KFKSDS", "stats"), ...)
## S3 method for class 'stsmFit':
tsSmooth(object, version = c("KFKSDS", "stats"), ...)
## S3 method for class 'stsmSmooth':
plot(x, ...)
## S3 method for class 'stsmFit':
tsdiag(object, gof.lag = 10L, ...)stsm or a stsmFit list.stsmFit list. For plot methods it is a list of class
stsmComponents, stsmPredict or stsmSmooth.print.default.TRUE residuals are standardised.TRUE standardised are returned.TRUE standard errors of the predictions are returned.stsmComponents
containing the filtered components and residuals.StructTS in the stsmFit list returned by
maxlik.fd and maxlik.td.
Nevertheless, as the information and the data required by these methods
are available in the slots of a stsm object, they
can also be applied directly on an object of class stsm.
This can be useful, for example, when we know a set of parameter estimates
that was obtained from a method other than maxlik.fd or maxlik.td.
By simply updating the slot pars of the stsm object,
the residuals and the filtered and smoothed components
are readily available through these methods.In most cases, the ellipsis, ..., is kept in the definitions of the methods
just because it is part of the parent method. It has some functionality nonetheless.
For the methods fitted.stsm and predict.stsm it can be used to pass
argument P0cov to function char2numeric.
It can also be used to pass graphical parameters to par in
method plot.stsmComponents and plot.stsmSmooth or to plot
in plot.stsmPredict and plot.stsmSmooth.
By default in method fitted, std.rediduals = TRUE so that
it behaves as in previous versions of the package where this
argument was not available.
In method rediduals, by default standardised = FALSE
because it is more convenient when used in package arima
models and for stsm).
confint.stsmFit,
maxlik.fd,
maxlik.td,
vcov.stsmFit,
stsm.# fit the local level plus seasonal model to a
# sample simulated series
data("llmseas")
m <- stsm.model(model = "llm+seas", y = llmseas)
res <- maxlik.fd.scoring(m = m, step = NULL,
information = "expected", control = list(maxit = 100, tol = 0.001))
print(res)
#diagnostic
tsdiag(res)
# display estimated components with 95% confidence bands
comps <- tsSmooth(res)
plot(comps)
title(main = "smoothed trend and seasonal components")
# plot predictions eight periods ahead
pred <- predict(res, n.ahead = 8, se.fit = TRUE)
plot(pred)Run the code above in your browser using DataLab