# 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