ardec.lm {ArDec}R Documentation

Function to fit an autoregressive model as a linear regression

Description

Function ardec.lm fits an autoregressive model of order p, AR(p) to a time series through a linear least squares regression.

Function ardec.lm.bayes provides a sample of autoregressive parameters from the multivariate normal posterior distribution for the coefficients assuming a (non-informative) reference prior.

Usage

ardec.lm(x, method = "burg", na.action = na.contiguous)

ardec.lm.bayes(x, method = "burg", na.action = na.contiguous, R, med = TRUE, seed = 1)

Arguments

x time series
method method used to fit the model ("yule-walker", "burg", "ols", "mle", "yw"); defaults to "burg"
na.action function to be called to handle missing values; defaults to na.contiguous
R size of sample to be simulated from posterior
med logical, indicating if a median vector of autoregressive parameters should be computed from the simulated sample
seed integer for set.seed

Value

For ardec.lm, an object of class "lm".
For ardec.lm.bayes an Rxp matrix containing the samples of autoregressive coefficients as columns (if med=FALSE).
If med=TRUE, ardec.lm.bayes returns a single column matrix containing the median vector of autoregressive parameters.

Author(s)

S. M. Barbosa

See Also

ar, lm

Examples

data(tempEng)
model=ardec.lm(tempEng)

[Package ArDec version 1.2-3 Index]