Learn R Programming

deseats (version 1.1.0)

arma_to_ma: MA Representation of an ARMA Model

Description

Calculate the coefficients of the infinite-order MA-representation of a given ARMA model.

Usage

arma_to_ma(ar = numeric(0), ma = numeric(0), max_i = 1000)

Value

A numeric vector is returned.

Arguments

ar

a numeric vector with the AR parameters of the ARMA model; should be ordered from \(a_1\) to \(a_p\) (see Details).

ma

a numeric vector with the MA parameters of the ARMA model; should be ordered from \(b_1\) to \(b_q\) (see Details).

max_i

a single numeric value that indicates how many coefficients should be returned; returned will be max_i + 1 coefficients (the coefficient for index 0 is also returned as the first value).

Author

  • Dominik Schulz (Research Assistant) (Department of Economics, Paderborn University),
    Author and Package Creator

Details

Consider an ARMA model $$X_t = a_1 X_{t-1} + ... + a_p X_{t-p} + b_1 \epsilon_{t-1} + ... + b_q \epsilon_{t-q} + \epsilon_t,$$ where \(a_1, ..., a_p\) and \(b_1, ..., b_q\) are its real-valued coefficients. The function arma_to_ar() uses these coefficients as input to calculate the coefficients of the truncated infinite-order MA-representation of the model defined through these coefficients. Note that the stationarity and invertibility of the model defined through the provided coefficients is not being checked.

NOTE:

This function implements C++ code by means of the Rcpp and RcppArmadillo packages for better performance.

Examples

Run this code
ar <- c(1.2, -0.4)
ma <- c(0.5)
arma_to_ma(ar = ar, ma = ma, max_i = 100)

Run the code above in your browser using DataLab