View source: R/sample_ARMA_coef.R
sample_ARMA_coef | R Documentation |
This function randomly samples the ARMA coefficients of a specified ARMA model. The coefficients are sampled so that the resulting ARMA model is both causal and invertible.
sample_ARMA_coef(
order = c(0L, 0L),
seasonal = list(order = c(0L, 0L), period = NA),
n = 1,
Mod_bounds = c(0.05, 0.95),
min_inv_root_dist = 0
)
order |
A specification of the non-seasonal part of the ARIMA model:
this is different than the |
seasonal |
A specification of the seasonal part of the ARIMA model. Can
be either a vector of length 2, or a list with an |
n |
An integer indicating how many sets of ARMA coefficients should be sampled. |
Mod_bounds |
Bounds on the magnitude of the roots. |
min_inv_root_dist |
This parameter is included so as to help avoid ARMA
models that contain parameter redundancy, if desired. Specifically,
this parameter ensures that the minimum distance between any of the
inverted roots in the AR and MA polynomials is greater than
|
For an ARMA model to be causal and invertible, the roots of the AR and MA polynomials must lie outside the the complex unit circle. The AR and MA polynomials are defined as:
\phi(z) = 1 - \phi_1 z - \phi_2 z^2 - \ldots - \phi_p z^p
\theta(z) = 1 + \theta_1 z + \theta_2 z^2 + \ldots + \theta_q z^q
where z
is a complex number, \phi_1, \ldots, \phi_p
are the
p
AR coefficients of the ARMA model, and
\theta_1, \ldots, \theta_p
are the q
MA coefficients of the ARMA
model.
ARMA coefficients are sampled by sampling inverse roots to be inside the complex unit circle, and then calculating the resulting polynomial. To ensure that the resulting polynomial coefficients are real, we only sample half of the needed number of complex roots, and set the remaining half to be the complex conjugate of the sampled points. In the case where the number of coefficients is odd, the remaining root is sampled uniformly, satisfying the Mod_bounds parameter.
a vector of randomly sampled ARMA coefficients.
{
sample_ARMA_coef(
order = c(2, 1),
seasonal = list(order = c(1, 0), period = 2),
n = 100
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.