Learn R Programming

astsa (version 2.4)

arma.spec: Spectral Density of an ARMA Model

Description

Gives the ARMA model spectrum, but first tests for causality and invertibility, and then for parameter redundancy.

Usage

arma.spec(ar = 0, ma = 0, var.noise = 1, n.freq = 500, main = NULL, redundancy.tol=.1,
            frequency = 1, ylim = NULL, plot = TRUE, ...)

Value

freq

frequencies - returned invisibly

spec

spectral ordinates - returned invisibly

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; default is "ARMA" with orders "(p, q)"

redundancy.tol

tolerance for reporting parameter redundancy

frequency

for plotting, adjusts the frequency axis units

ylim

optional; specify limits for the y-axis

plot

if TRUE (default), produces a graphic

...

additional arguments for the graphic

Author

D.S. Stoffer

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, a stop error with a message is given; e.g., arma.spec(ar=1, ma=1) will just produce warnings.

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. See arma.check for details on the evaluation of parameter redundancy.

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/.

See Also

arma.check

Examples

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

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

arma.spec(ar = -.9, ma=.89, gg=TRUE)  # almost white noise

# if you want a seasonal model, you have to be a little clever
arma.spec(ar=c(rep(0,11),.4), ma=.5, col=5, lwd=3, frequency=12)

Run the code above in your browser using DataLab