| msarima.sim | R Documentation |
Simulates a time series from a multi-seasonal ARIMA model with specified parameters. This function provides a direct interface for simulation without requiring a fitted model object.
msarima.sim(
nsim,
order = c(0, 0, 0),
seasonal = list(),
seasonal.period = NULL,
ar = NULL,
ma = NULL,
sigma2 = 1,
burn = NULL,
intercept = 0
)
nsim |
Length of the simulated series (required). |
order |
A numeric vector of length 3 specifying the non-seasonal part of the
ARIMA model: the AR order (p), the degree of differencing (d), and the MA order (q).
Default is |
seasonal |
A list of numeric vectors, each of length 3, specifying the seasonal
components. Each vector gives the seasonal AR order (P), the seasonal differencing
order (D), and the seasonal MA order (Q) of one component. Use |
seasonal.period |
A numeric vector of seasonal periods, one for each element of
|
ar |
Numeric vector of AR coefficients, non-seasonal first and then one block per
seasonal component. Its length must match the total AR order implied by |
ma |
Numeric vector of MA coefficients, ordered as |
sigma2 |
Innovation variance. Default is 1. |
burn |
Number of burn-in observations to discard. If |
intercept |
Constant term of the model equation, that is |
A time series object of length nsim: ts with one seasonal period,
msts with several.
msarima, simulate.msarima
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.