predict.statespace
makes a prediction for a statespace object, in the offline or online
setting.
# S3 method for statespace
predict(
object,
newX,
newy = NULL,
online = TRUE,
compute_smooth = FALSE,
type = c("mean", "proba", "model"),
...
)
Depending on the type specified, the result is
- a vector of mean forecast if type='mean'
- a list of two vectors, mean forecast and standard deviations if type='proba'
- a statespace object if type='model'
the statespace object
the design matrix in the prediction set
(default NULL
) the variable of interest in the prediction set. If specified
it allows to use the state-space model in the online setting. Otherwise the prediction is
offline.
(default TRUE
) specifies if the prediction is made online, that is if
the observation at time t-1 is used to update the model before predicting at time t.
(default FALSE
) specifies if Kalman Smoothing is also computed.
type of prediction. Can be either
return the mean forecast.
return a probabilistic forecast (list containing estimation of the mean and standard deviation).
return the updated statespace object (containing also the forecasts).
additional parameters