Learn R Programming

KFAS (version 1.0.3)

predict.SSModel: State Space Model Predictions

Description

Function predict.SSModel predicts the future observations of a state space model of class SSModel

Usage

## S3 method for class 'SSModel':
predict(object, newdata, interval = c("none", "confidence",
  "prediction"), level = 0.95, type = c("response", "link"),
  states = NULL, se.fit = FALSE, nsim = 0, prob = TRUE, ...)

Arguments

object
Object of class SSModel.
newdata
A compatible SSModel object to be added in the end of the old object for which the predictions are required.
interval
Type of interval calculation.
level
Confidence level for intervals.
type
Scale of the prediction, 'response' or 'link'.
states
Which states are used in computing the predictions. Either a numeric vector containing the indices of the corresponding states, or a character vector defining the types of the corresponding states. Possible choices are all,
nsim
Number of independent samples used in importance sampling. Used only for non-Gaussian models.
se.fit
If TRUE, standard errors are computed. Default is FALSE.
prob
if TRUE (default), the predictions in binomial/poisson case are probabilities/rates instead of counts.
...
Ignored.

Value

  • A matrix or list of matrices containing the predictions, and optionally standard errors.

Details

For non-Gaussian models, the results depend whether importance sampling is used (nsim>0). without simulations, the confidence intervals in response scale are computed in linear predictor scale, and then transformed to response scale. The prediction intervals are not supported. With importance sampling, the confidence intervals are computed as the empirical quantiles from the weighted sample, whereas the prediction intervals contain additional step of simulating the response variables from the sampling distribution $p(y|\theta^i)$. If no simulations are used, the standard errors in response scale are computed using delta method.