predict_marssMLE: Compute the Prediction Intervals, Expected Values, and...

Description Usage Arguments Details Value Author(s) See Also

Description

This function is still in beta development. Not exported in version 3.5. Computes the expected values of states (X component) and observations (Y component) for MARSS models fit with MARSS. A list of newdata, which includes the inputs (e.g. c and d in a marxss model) must be passed in if they are included in the model. Optionally data (Y) can be passed in in newdata. This can be the original data or new data and can have missing values. To simulate data, use simulate.marssMLE.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'marssMLE'
predict(object, ..., 
                           n.ahead=1, 
                           t.start=NULL, 
                           newdata=list(), 
                           se.fit=TRUE, 
                           nboot=1000, 
                           param.gen="hessian", 
                           verbose=FALSE, 
                           prediction.intervals=TRUE)

Arguments

object

A marssMLE object marssMLE.

...

Not used.

n.ahead

Number of time steps ahead to predict (starting from t.start).

t.start

A what t to start the prediction relative to the start (t=1) of the data to which the model was fit. The default is to start at t=T+1, where T is the length of the data to which the model was fit. For example, if TT=10, t.start=1 and n.ahead = 5, prediction is for time steps 1, 2, 3, 4, 5 so is not past the end of the data.

newdata

Data (explanatory variables) to be used for prediction if included in the model.

se.fit

Logical: should standard errors of prediction be returned?

prediction.intervals

Logical. Whether to return prediction intervals. Calculation of prediction intervals can be slow (if param.gen="MLE") and will exit with an error if the Hessian cannot be computed (if param.gen="hessian").

param.gen

"MLE" or "hessian". Default="hessian". The perdiction interval calculation requires samples of the parameters from their estimated distribution. You can generate these via the estimated Hessian matrix (fast but assumes normality) or via parametric bootstrapped (terribly slow).

nboot

Number of bootstrapped parameter sequences to generate for the prediction interval calculation.

verbose

If TRUE, the boot straps used for the prediction interval calculation are returned.

Details

newdata needs to be consistent with the model fitted. Thus if the model included inputs (in X or Y component) then these must also be included in newdata and have the proper size and form. If newdata$data is not passed in, then data (Y component) are assumed to be all missing and the expected values of the data (Ys) will be returned. The data is assumed to be all missing even if t.start is less than T and thus the prediction period overlaps the data to which the model was fit. If that data should be included in the predictions, then it must be passed in in newdata. The number of time steps in components of newdata must be consistent with n.ahead.

Prediction of the state (X) component is via the Kalman smoother (i.e. conditioned on all the data, if there is any) using MARSSkf. Prediction of the observation (Y) component is via MARSShatyt, and is also smoothed (i.e. conditioned on all the data, if there is any). The standard errors of prediction exclude the uncertainty in the estimation of the model parameters. You could use bootstrapping via MARSSboot if you wanted to include that.

Value

E.x

A matrix of the expected values of the states (X) given newdata. This is the Kalman smoother xtT output using newdata as the input for data and any inputs. See MARSSkf.

E.y

A matrix of the expected values of the observations (Y) given newdata. This is ytT output using newdata as the input for data and any inputs. See MARSShatyt.

x.se

A matrix of the estimated standard errors of the X predictions.

y.se

A matrix of the estimated standard errors of the Y predictions.

newdata

The newdata list that was constructed from the inputs.

pred.MLEobj

The marssMLE object that was constructed with newdata. This can be passed to MARSSkf if the full Kalman filter and smoother output is needed.

pred.MLEobj

The marssMLE object that was constructed with newdata. This can be passed to MARSSkf if the full Kalman filter and smoother output is needed.

pred.MLEobj

The marssMLE object that was constructed with newdata. This can be passed to MARSSkf if the full Kalman filter and smoother output is needed.

Author(s)

Eli Holmes and Eric Ward, NOAA, Seattle, USA.

eli(dot)holmes(at)noaa(dot)gov, eric(dot)ward(at)noaa(dot)gov

See Also

marssMODEL marssMLE MARSSboot


gragusa/MARSS documentation built on May 17, 2019, 8:18 a.m.