Learn R Programming

timsac (version 1.3.0)

armafit: ARMA Model Fitting

Description

Fit an ARMA model with specified order by using DAVIDON's algorithm.

Usage

armafit(y, model.order)

Arguments

y
a univariate time series.
model.order
a numerical vector of the form c(ar, ma) which gives the order to be fitted successively.

Value

  • arcoefmaximum likelihood estimates of AR coefficients.
  • macoefmaximum likelihood estimates of MA coefficients.
  • arstdstandard deviation (AR).
  • mastdstandard deviation (MA).
  • vinnovation variance.
  • aicAIC.
  • gradfinal gradient.

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 algorithm. Pure autoregression is not allowed.

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

Run this code
# "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=-0.5), 1000)
  z <- armafit(y, model.order=c(2,1))
  z$arcoef
  z$macoef

Run the code above in your browser using DataLab