Learn R Programming

gmwm (version 2.0.0)

ARMAtoMA_cpp: Converting an ARMA Process to an Infinite MA Process

Description

Takes an ARMA function and converts it to an infinite MA process.

Usage

ARMAtoMA_cpp(ar, ma, lag_max)

Arguments

ar
A column vector of length p
ma
A column vector of length q
lag_max
A int of the largest MA(Inf) coefficient required.

Value

A column vector containing coefficients

Details

This function is a port of the base stats package's ARMAtoMA. There is no significant speed difference between the two.

Examples

Run this code
# ARMA(2,1)
ARMAtoMA_cpp(c(1.0, -0.25), 1.0, 10)
# ARMA(0,1)
ARMAtoMA_cpp(numeric(0), 1.0, 10)

Run the code above in your browser using DataLab