predict.statespace {viking}R Documentation

Predict using a statespace object

Description

predict.statespace makes a prediction for a statespace object, in the offline or online setting.

Usage

## S3 method for class 'statespace'
predict(
  object,
  newX,
  newy = NULL,
  online = TRUE,
  compute_smooth = FALSE,
  type = c("mean", "proba", "model"),
  ...
)

Arguments

object

the statespace object

newX

the design matrix in the prediction set

newy

(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.

online

(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.

compute_smooth

(default FALSE) specifies if Kalman Smoothing is also computed.

type

type of prediction. Can be either

mean

return the mean forecast.

proba

return a probabilistic forecast (list containing estimation of the mean and standard deviation).

model

return the updated statespace object (containing also the forecasts).

...

additional parameters

Value

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'


[Package viking version 1.0.2 Index]