bsts
object.## S3 method for class 'bsts':
predict(object,
newdata,
horizon = 1,
burn = SuggestBurn(.1, object),
na.action = na.exclude,
olddata,
quantiles = c(.025, .975),
...)
bsts
created by a call to the
function bsts
.object
contains a regression compoent. If a data
frame, it must include variables with the same names aobject
contains a regression
component then the forecast horizon is nrow(X)
, and this
argument is not used.object
to be discarded as burn-in. If
burn <= 0<="" code=""> then no burn-in period will be discarded.=>
newdata
.predict
function. It is not used.bsts.prediction
, which is a list
with the following components.If predictor variables are present, the regression coefficients are fixed (as opposed to time varying, though time varying coefficients might be added as state component). The predictors and response in the formula are contemporaneous, so if you want lags and differences you need to put them in the predictor matrix yourself.
If no predictor variables are used, then the model is an ordinary state space time series model.
Durbin and Koopman (2001), "Time series analysis by state space methods", Oxford University Press.
bsts
.
AddLocalLevel
.
AddLocalLinearTrend
.
AddGeneralizedLocalLinearTrend
.data(AirPassengers)
y <- log(AirPassengers)
ss <- AddLocalLinearTrend(list(), y)
ss <- AddSeasonal(ss, y, nseasons = 12)
model <- bsts(y, state.specification = ss, niter = 500)
pred <- predict(model, horizon = 12, burn = 100)
plot(pred)
Run the code above in your browser using DataLab