object.## S3 method for class 'ets':
simulate(object, nsim=length(object$x), seed=NULL, future=TRUE,
bootstrap=FALSE, innov=NULL, ...)
## S3 method for class 'ar':
simulate(object, nsim=object$n.used, seed=NULL, future=TRUE,
bootstrap=FALSE, innov=NULL, ...)
## S3 method for class 'Arima':
simulate(object, nsim=length(object$x), seed=NULL, xreg=NULL, future=TRUE,
bootstrap=FALSE, innov=NULL, lambda=object$lambda, ...)
## S3 method for class 'fracdiff':
simulate(object, nsim=object$n, seed=NULL, future=TRUE,
bootstrap=FALSE, innov=NULL, ...)ets", "Arima" or "ar".set.seed
before simulating the time series. The default, NULL will not change the random generator state.object.bootstrap and seed are ignored.NULL, the simulated series is transformed using an inverse Box-Cox transformation with parameter lamda.ts".simulate.Arima(), the object should be produced by Arima or auto.arima, rather than arima. By default, the error series is assumed normally distributed and generated using rnorm. If innov is present, it is used instead. If bootstrap=TRUE and innov=NULL, the residuals are resampled instead.ets, Arima, auto.arima, ar, arfima.fit <- ets(USAccDeaths)
plot(USAccDeaths,xlim=c(1973,1982))
lines(simulate(fit, 36),col="red")Run the code above in your browser using DataLab