forecast (version 2.01)

simulate.ets: Simulation from an ETS model

Description

Returns a time series based on the model object object.

Usage

## S3 method for class 'ets':
simulate(object, nsim=length(object$x), seed=NULL, initstate=object$state[1,], bootstrap=TRUE, ...)

Arguments

object
An object of class "ets". Usually the result of a call to ets.
nsim
Number of periods for the simulated series
seed
Either NULL or an integer that will be used in a call to set.seed before simulating the time seriers. The default, NULL will not change the random generator state.
initstate
State at time 0.
bootstrap
If TRUE, simulation uses resampled errors rather than normally distributed errors.
...
Other arguments.

Value

  • An object of class "ts".

See Also

ets

Examples

Run this code
fit <- ets(USAccDeaths)
plot(simulate(fit, 100))

Run the code above in your browser using DataCamp Workspace