prediction.MSAR: One step ahead predict for (non) homogeneous MSAR models

Description Usage Arguments Value Author(s) See Also Examples

View source: R/prediction.MSAR.R

Description

computes one step ahead predict for (non) homogeneous MSAR models. A time series is given as input and a prediction is return for each time. These function is mainly usefull for cross-validation.

Usage

1
prediction.MSAR(data, theta, covar.emis = NULL, covar.trans = NULL, ex = 1)

Arguments

data

observed time series, array of dimension T*N.samples*d

theta

object of class MSAR including the model's parameter

covar.emis

covariate for emissions (if needed)

covar.trans

covariate for transitions (if needed)

ex

numbers of samples for which prediction has to be computed

Value

Returns a list with the following elements:

y.p

the one step ahead prediction for each time of data time series

var.p

the associated variance

pr

the prediction probabilities for each regime

Author(s)

Valerie Monbet, valerie.monbet@univ-rennes1.fr

See Also

Cond.prob.MSAR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run
#data(meteo.data)
#data = array(meteo.data$temperature,c(31,41,1)) 
#T = dim(data)[1]
#N.samples = dim(data)[2]
#d = dim(data)[3]
#M = 2
#theta.init = init.theta.MSAR(data,M=M,order=2,label="HH")
#res.hh.2 = fit.MSAR(data,theta.init,verbose=TRUE,MaxIter=200)
#y.p.2 = prediction.MSAR(data,res.hh.2$theta,ex=1:N.samples)
#RMSE.2 = mean((data-y.p.2$y.p)^2)

Example output



NHMSAR documentation built on Feb. 9, 2022, 9:06 a.m.