predict.dynrModel: 'predict' method for 'dynrModel' objects

View source: R/dynrPredict.R

predict.dynrModelR Documentation

predict method for dynrModel objects

Description

predict method for dynrModel objects

Usage

## S3 method for class 'dynrModel'
predict(object, newdata = NULL, interval = c("none",
  "confidence", "prediction"), method = c("kalman", "ensemble"),
  level = 0.95, type = c("latent", "observed"), ...)

Arguments

object

a dynrModel object from which predictions are desired

newdata

an optional data.frame or ts object. See details.

interval

character indicating what kind of intervals are desired. 'none' gives no intervals, 'confidence', gives confidence intervals, 'prediction' gives prediction intervals.

method

character the method used to create the forecasts. See details.

level

the confidence or predictions level, ignored if not using intervals

type

character the type of thing you want predicted: latent variables or manifest variables.

...

further named arguments, e.g., size for the ensemble size when using the ensemble prediction

Details

The newdata argument is either a data.frame or ts object. It passed as the dataframe argument of dynr.data and must accept the same further arguments as the data in the model passed in the object argument (e.g., same id, time, observed, and covariates arguments).

The available methods for prediction are 'kalman' and 'ensemble'. The 'kalman' method uses the Kalman filter to create predictions. The 'ensemble' method simulates a set of initial conditions and lets those run forward in time. The distribution of this ensemble provides the predictions. The mean is the value predicted. The quantiles of the distribution provide the intervals.

Value

A list of the prediction estimates, intervals, and ensemble members.


dynr documentation built on May 29, 2024, 2:49 a.m.