Learn R Programming

timsac (version 1.3.0)

xsarma: Exact Maximum Likelihood Method of Scalar ARMA Model Fitting

Description

Produce exact maximum likelihood estimates of the parameters of a scalar ARMA model.

Usage

xsarma(y, arcoefi, macoefi)

Arguments

y
a univariate time series.
arcoefi
initial estimates of AR coefficients.
macoefi
initial estimates of MA coefficients.

Value

  • gradiinitial gradient.
  • lkhoodiinitial (-2)log likelihood.
  • arcoeffinal estimates of AR coefficients.
  • macoeffinal estimates of MA coefficients.
  • gradfinal gradient.
  • alph.arfinal ALPH (AR part) at subroutine ARCHCK.
  • alph.mafinal ALPH (MA part) at subroutine ARCHCK.
  • lkhoodfinal (-2)log likelihood.
  • wnoise.varwhite noise variance.

Details

The ARMA model is given by $$y(t) - a(1)y(t-1) - \ldots - a(p)y(t-p) = u(t) - b(1)u(t-1) - ... - b(q)u(t-q),$$ where $p$ is AR order, $q$ is MA order and $u(t)$ is a zero mean white noise.

References

H.Akaike (1978) Covariance matrix computation of the state variable of a stationary Gaussian process. Research Memo. No.139. The Institute of Statistical Mathematics. H.Akaike, G.Kitagawa, E.Arahata and F.Tada (1979) Computer Science Monograph, No.11, Timsac78. 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".
  arcoef <- c(1.45, -0.9)
  macoef <- c(-0.5)
  y <- arima.sim(list(order=c(2,0,1), ar=arcoef, ma=macoef), n=100)
  arcoefi <- c(1.5, -0.8)
  macoefi <- c(0.0)
  z <- xsarma(y, arcoefi, macoefi)
  z$arcoef
  z$macoef

Run the code above in your browser using DataLab