Description Usage Arguments Value Author(s) See Also Examples
Returns a time series based on the model object object
.
1 2 3 4 5 6 7 8 9 10 11 12 | ## S3 method for class 'ets'
simulate(object, nsim=length(object$x), seed=NULL, future=TRUE,
bootstrap=FALSE, ...)
## S3 method for class 'ar'
simulate(object, nsim=object$n.used, seed=NULL, future=TRUE,
bootstrap=FALSE, ...)
## S3 method for class 'Arima'
simulate(object, nsim=length(object$x), seed=NULL, xreg=NULL, future=TRUE,
bootstrap=FALSE, ...)
## S3 method for class 'fracdiff'
simulate(object, nsim=object$n, seed=NULL, future=TRUE,
bootstrap=FALSE, ...)
|
object |
An object of class " |
nsim |
Number of periods for the simulated series |
seed |
Either NULL or an integer that will be used in a call to |
future |
Produce sample paths that are future to and conditional on the data in |
bootstrap |
If TRUE, simulation uses resampled errors rather than normally distributed errors. |
xreg |
New values of xreg to be used for forecasting. Must have nsim rows. |
... |
Other arguments. |
An object of class "ts
".
Rob J Hyndman
ets
, Arima
, auto.arima
, ar
, arfima
.
1 2 3 | fit <- ets(USAccDeaths)
plot(USAccDeaths,xlim=c(1973,1982))
lines(simulate(fit, 36),col="red")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.