arma.spec: Spectral Density of an ARMA Model

View source: R/arma.spec.R

arma.specR Documentation

Spectral Density of an ARMA Model

Description

Gives the ARMA spectrum, tests for causality, invertibility, and common zeros.

Usage

arma.spec(ar = 0, ma = 0, var.noise = 1, n.freq = 500,
          main='from specified model', frequency=1, ylim=NULL, plot=TRUE, ...)

Arguments

ar

vector of AR parameters

ma

vector of MA parameters

var.noise

variance of the noise

n.freq

number of frequencies

main

title of graphic

frequency

for seasonal models, adjusts the frequency scale

ylim

optional; specify limits for the y-axis

plot

if TRUE (default), produces a graphic

...

additional arguments

Details

The basic call is arma.spec(ar, ma) where ar and ma are vectors containing the model parameters. Use log='y' if you want the plot on a log scale. If the model is not causal or invertible an error message is given. If there are approximate common zeros, a spectrum will be displayed and a warning will be given; e.g., arma.spec(ar= .9, ma= -.9) will yield a warning and the plot will be the spectrum of white noise.

Value

freq

frequencies - returned invisibly

spec

spectral ordinates - returned invisibly

Author(s)

D.S. Stoffer

References

You can find demonstrations of astsa capabilities at FUN WITH ASTSA.

The most recent version of the package can be found at https://github.com/nickpoison/astsa/.

In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.

The webpages for the texts and some help on using R for time series analysis can be found at https://nickpoison.github.io/.

Examples

arma.spec(ar = c(1, -.9), ma = .8)

arma.spec(ar = c(1, -.9), log='y')

arma.spec(ar = c(1, -.9), main='AR(2)', gg=TRUE, col=5, lwd=2)

arma.spec(ar=c(rep(0,11),.4), ma=.5, col=5, lwd=3, frequency=12)

astsa documentation built on May 29, 2024, 10:29 a.m.