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.

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

`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 |

Returns a list with the following elements:

`y.p` |
the one step ahead prediction for each time of data time series |

`pr` |
the prediction probabilities for each regime |

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

Cond.prob.MSAR

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)^2)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.