| simulate.msarima | R Documentation |
Returns a simulated time series from a fitted ARIMA model with one or more seasonal components.
## S3 method for class 'msarima'
simulate(object = NULL, nsim = 100, seed = NULL, burn = NULL, ...)
object |
An object of class |
nsim |
Length of the simulated series. Default is 100. |
seed |
Either |
burn |
Number of burn-in observations to discard. If |
... |
Additional arguments (currently not used). |
The model specification and the estimated parameters, including the constant term when
the model was fitted with include.constant = TRUE, are extracted from the fitted
object and passed to msarima.sim.
A time series object (ts or msts) of length nsim, with the
seasonal periods of the fitted model.
msarima, msarima.sim
# Simulate data
set.seed(123)
y <- msarima.sim(nsim = 200,
order = c(1, 0, 0),
seasonal = list(c(1, 0, 0), c(0, 0, 1)),
seasonal.period = c(4, 11),
ar = c(0.5, 0.5), ma = 0.3, sigma2 = 1)
# Fit model
fit <- msarima(y, order = c(1, 0, 0),
seasonal = list(c(1, 0, 0), c(0, 0, 1)),
seasonal.period = c(4, 11))
# Simulate from fitted model
y_sim <- simulate(fit, nsim = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.