autoarmafit {timsac}R Documentation

Automatic ARMA Model Fitting

Description

Provide an automatic ARMA model fitting procedure. Models with various orders are fitted and the best choice is determined with the aid of the statistics AIC.

Usage

  autoarmafit(y, max.order=NULL, tmp.file=NULL)

Arguments

y a univariate time series.
max.order upper limit of AR order and MA order. Default is 2*sqrt(n), where n is the length of the time series y.
tmp.file a character string naming a file written intermediate results of model fitting. If NULL (default) output no file.

Details

The maximum likelihood estimates of the coefficients of a scalar ARMA model

y(t) - a(1)y(t-1) -...- a(p)y(t-p) = u(t) - b(1)u(t-1) -...- b(q)u(t-q)

of a time series y(t) are obtained by using DAVIDON's variance algorithm. Where p is AR order, q is MA order and u(t) is a zwro mean white noise. Pure autoregression is not allowed.

Value

best.order the order of the best ARMA model.
best.model Tte best choice of ARMA coefficients.
model a list with components named arcoef (Maximum likelihood estimates of AR coefficients), macoef (Maximum likelihood estimates of MA coefficients), arstd (AR standard deviation), mastd (MA standard deviation), v (Innovation variance), aic (AIC = n log( det(v) ) + 2( p+q )) and grad (Final gradient) in AIC increasing order.

References

H.Akaike, E.Arahata and T.Ozaki (1975) Computer Science Monograph, No.5, Timsac74, A Time Series Analysis and Control Program Package (1). The Institute of Statistical Mathematics.

Examples

  # "arima.sim" is a function in "stats".
  # Note that the sign of MA coefficient is opposite from that in "timsac".
  y <- arima.sim(list(order=c(2,0,1),ar=c(0.64,-0.8),ma=c(-0.5)),n=1000)
  z <- autoarmafit(y)
  z$best.order
  z$best.model

[Package timsac version 1.2.1 Index]