sample_ARMA_coef {arima2} | 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)
)
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. |
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 first coefficient is sampled as a real number between 0-1, the remaining roots are sampled as described, and then the resulting polynomial is checked to ensure all roots lie outside the unit circle; if not, we resample the coefficients.
a vector of randomly sampled ARMA coefficients.
{
sample_ARMA_coef(
order = c(2, 1),
seasonal = list(order = c(1, 0), period = 2),
n = 100
)
}