Description Usage Arguments Value Author(s) See Also Examples

View source: R/prediction.MSAR.R

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, [email protected]

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.