ARMME
Computes method of moments estimates of the autoregressive parameters of an ARMA model.
Required Arguments
MAXLAG — Maximum lag of the sample autocovariances of the time series W. (Input)
MAXLAG must be greater than or equal to NPAR + NPMA.
ACV — Vector of length MAXLAG + 1 containing the sample autocovariances of W. (Input)
The k‑th sample autocovariance of W is denoted by ACV(k), k = 0, 1, …, MAXLAG.
NPMA — Number of moving average parameters. (Input)
NPMA must be greater than or equal to zero.
NPAR — Number of autoregressive parameters. (Input)
NPAR must be greater than or equal to one.
PAR — Vector of length NPAR containing the estimates of the autoregressive parameters. (Output)
Optional Arguments
IPRINT — Printing option. (Input)
Default: IPRINT = 0.
IPRINT |
Action |
0 |
No printing is performed. |
1 |
Prints the estimates of the autoregressive parameters. |
FORTRAN 90 Interface
Generic: CALL ARMME (MAXLAG, ACV, NPMA, NPAR, PAR [, …])
Specific: The specific interface names are S_ARMME and D_ARMME.
FORTRAN 77 Interface
Single: CALL ARMME (MAXLAG, ACV, IPRINT, NPMA, NPAR, PAR)
Double: The double precision name is DARMME.
Description
Routine ARMME determines the autoregressive parameters of an ARMA process using the extended Yule‑Walker equations given the K = MAXLAG autocovariances σ(k) for k = 1, …, K.
Suppose the time series {Wt} is generated by an ARMA(p, q) model
Wt= θ0 + ɸ1Wt−1 + … + ɸpWt−p + At − θ1At−1 − … − θqAt−q, t ∈{0, ± 1, ±2, …}
where p = NPAR and q = NPMA. Since Wt depends only on the innovations At that have occurred up through time t, the p autoregressive parameters are related to the autocovariances of lags k = q + 1, …, q + p by the set of equations
σ(q + 1) = ɸ1σ(q) + ɸ2σ(q ‑ 1) + … + ɸpσ(q ‑ p + 1)
σ(q + 2) = ɸ1σ(q + 1) + ɸ2σ(q) + … + ɸpσ(q ‑ p + 2)
.
.
.
σ(q + p) = ɸ1σ(q + p ‑ 1) + ɸ2σ(q + p ‑ 2) + … + ɸpσ(q)
This general system of linear equations is called the extended Yule‑Walker equations. For q = 0, the system is referred to as the Yule‑Walker equations. The equivalent matrix version is given by
Σɸ = σ
where
The overall constant θ0 is defined by
where μ is the mean of Wt.
In practice, the autocovariance function is estimated by the sample autocovariances
for k = 1, …, K. The solution of the extended Yule‑Walker equations using these sample moments yields the method of moments estimates of the autoregressive parameters. The overall constant may then be estimated given an estimate of μ. Note that the extended Yule‑Walker equations may be analogously defined in terms of autocorrelations instead of autocovariances. See Box and Jenkins (1976, pages 189–191) for some comments concerning the initial estimation of autoregressive parameters using the Yule‑Walker equations.
Comments
1. Workspace may be explicitly provided, if desired, by use of A2MME/DA2MME. The reference is:
CALL A2MME (MAXLAG, ACV, IPRINT, NPMA, NPAR, PAR, A, FACT, IPVT, WK)
The additional arguments are as follows:
A — Work vector of length equal to NPAR2.
FACT — Work vector of length equal to NPAR2.
IPVT — Work vector of length equal to NPAR.
WK — Work vector of length equal to NPAR.
2. Informational error
Type |
Code |
Description |
4 |
1 |
The problem is ill‑conditioned. Transformation of the data or increased precision in the calculations may be appropriate. |
3. The sample autocovariance function may be obtained using the routine ACF.
4. The first element of ACV must be the sample variance of the time series.
Example
Consider the Wölfer Sunspot Data (Anderson 1971, page 660) consisting of the number of sunspots observed each year from 1749 through 1924. The data set for this example consists of the number of sunspots observed from 1770 through 1869. Routine ARMME is invoked first to compute the method of moments estimates for the autoregressive parameters of an ARMA(2, 0) model given the sample autocovariances computed from routine ACF. Then, ARMME is invoked a second time to compute estimated autoregressive parameters for an ARMA(2, 1) model.
USE UMACH_INT
USE GDATA_INT
USE ACF_INT
USE ARMME_INT
IMPLICIT NONE
INTEGER IMEAN, IPRINT, ISEOPT, MAXLAG, NOBS
PARAMETER (IMEAN=1, IPRINT=1, ISEOPT=0, MAXLAG=4, NOBS=100)
!
INTEGER NCOL, NOUT, NPAR, NPMA, NROW
REAL AC(0:MAXLAG), ACV(0:MAXLAG), PAR(2), RDATA(176,2), &
SEAC(1), W(100), WMEAN
!
EQUIVALENCE (W(1), RDATA(22,2))
!
CALL UMACH (2, NOUT)
! Wolfer Sunspot Data for
! years 1770 through 1869
CALL GDATA (2, RDATA, NROW, NCOL)
! Compute sample ACV
CALL ACF (W, MAXLAG, AC, ACV=ACV)
! Compute estimates of autoregressive
! parameters for ARMA(2,0) model
! (Box and Jenkins, page 83)
WRITE (NOUT,*) 'ARMA(2,0) Model'
NPAR = 2
NPMA = 0
CALL ARMME (MAXLAG, ACV, NPMA, NPAR, PAR, IPRINT=IPRINT)
! Compute estimates of autoregressive
! parameters for ARMA(2,1) model
WRITE (NOUT,*) ' '
WRITE (NOUT,*) 'ARMA(2,1) Model'
NPMA = 1
CALL ARMME (MAXLAG, ACV, NPMA, NPAR, PAR, IPRINT=IPRINT)
!
END
Output
ARMA(2,0) Model
Output PAR
1 2
1.318 -0.635
ARMA(2,1) Model
Output PAR
1 2
1.244 -0.575