spec.ic {astsa}R Documentation

Estimate Spectral Density of a Time Series from AR Fit

Description

Fits an AR model to data and computes (and by default plots) the spectral density of the fitted model based on AIC (default) or BIC.

Usage

spec.ic(data, BIC = FALSE, order.max = 30, main = NULL, plot = TRUE, 
         detrend = FALSE, method=NULL, ...)

Arguments

data

a univariate time series.

BIC

if TRUE, fit is based on BIC. If FALSE (default), fit is based on AIC.

order.max

maximum order of models to fit. Defaults to 30.

main

title. Defaults to name of series, method and chosen order.

plot

if TRUE (default) produces a graphic of the estimated AR spectrum.

detrend

if TRUE, detrends the data first. Default is FALSE.

method

method of estimation - a character string specifying the method to fit the model chosen from the following: "yule-walker", "burg", "ols", "mle", "yw". Defaults to "yule-walker".

...

additional arguments.

Details

Uses ar to fit the best AR model based on pseudo AIC or BIC. No likelihood is calculated unless method='mle' is used, however, the calculations will be slow. The minimum centered AIC and BIC values and the spectral and frequency ordinates are returned silently.

Value

[[1]]

Matrix with columns: ORDER, AIC, BIC

[[2]]

Matrix with columns: freq, spec

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 are https://www.stat.pitt.edu/stoffer/tsa4/ and https://www.stat.pitt.edu/stoffer/tsda/.

See Also

ar, spec.ar

Examples

## Not run: 
# AIC
spec.ic(soi)  
spec.ic(sunspotz, method='burg', col=4)   

# BIC after detrending on log scale
spec.ic(soi, BIC=TRUE, detrend=TRUE, log='y')  

# plot AIC and BIC without spectral estimate
tsplot(0:30, spec.ic(soi, plot=FALSE)[[1]][,2:3], type='o', xlab='order', nxm=5)  

## End(Not run)

[Package astsa version 1.14 Index]