coefs2poly(x, morder, add = TRUE, ...)
Arima
object returned by arima
.arima
in element arma
. Ignored if x
is an
Arima
object.TRUE
, the polynomial of the differencing filter
(if present in the model) is multiplied byt the stationary autoregressive
polynomial. Otherwise only the coefficients of the product of the
stationary polynomials is returned.arcoefs
, the coefficients of the product of the
autoregressive polynomials;
macoefs
, the coefficients of the product of the
moving average polynomials.
This list is of class "ArimaPars"
so that it can be recognized by
outliers.tstatistics
.coefs2poly.Arima
may be more convenient since it
requires passing only one argument defining the model. However, since only the
coefficients of the model and the order of the model is required by this function,
there is no need to pass the complete Arima
object.polynomial
,
Ops.polynomial
.# ARIMA(0,1,1)(0,1,1) model
fit <- arima(log(AirPassengers), order = c(0,1,1),
seasonal = list(order = c(0,1,1)))
coefs <- coef(fit)
# "coefs2poly" returns the coefficients of the product of
# the non-seasonal and the seasonal moving average polynomials
pma <- polynom::polynomial(c(1, coefs[1]))
psma <- polynom::polynomial(c(1, rep(0, 11), coefs[2]))
coef(pma * psma)[-1]
coefs2poly(coef(fit), fit$arma)$macoefs
# since the model does not contain an autoregressive part
# the product of the regular and the seasonal differencing
# filter is returned if "add = TRUE"
coefs2poly(coef(fit), fit$arma)$arcoefs
# an empty set nothing is returned if "add = FALSE"
coefs2poly(coef(fit), fit$arma, add = FALSE)$arcoefs
# in a model with non-seasonal part and no differencing filter
# no multiplication of polynomials are involved and
# the output coincides with "coef"
fit <- arima(log(AirPassengers), order = c(1,0,1))
coef(fit)
coefs2poly(coef(fit), fit$arma)
Run the code above in your browser using DataLab