MAMME
Computes method of moments estimates of the moving average 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.
PAR — Vector of length NPAR containing the estimates of the autoregressive parameters. (Input)
PMA — Vector of length NPMA containing the estimates of the moving average parameters. (Output)
Optional Arguments
IPRINT — Printing option. (Input)
Default: IPRINT = 0.
IPRINT
Action
0
No printing is performed.
1
Prints the estimates of the moving average parameters.
NPAR — Number of autoregressive parameters. (Input)
NPAR must be greater than or equal to zero.
Default: NPAR = size (PAR,1).
RELERR — Stopping criterion for use in the nonlinear equation solver. (Input)
If RELERR = 0.0, then the default value RELERR = 100.0 * AMACH(4) is used. See the documentation for routine AMACH in the Reference Material.
Default: RELERR  = 0.0.
MAXIT — The maximum number of iterations allowed in the nonlinear equation solver. (Input)
If MAXIT = 0, then the default value MAXIT = 200 is used.
Default: MAXIT = 0.
NPMA — Number of moving average parameters. (Input)
NPMA must be greater than or equal to one.
Default: NPMA = size (PMA,1).
FORTRAN 90 Interface
Generic: CALL MAMME (MAXLAG, ACV, PAR, PMA [])
Specific: The specific interface names are S_MAMME and D_MAMME.
FORTRAN 77 Interface
Single: CALL MAMME (MAXLAG, ACV, IPRINT, NPAR, PAR, RELERR, MAXIT, NPMA, PMA)
Double: The double precision name is DMAMME.
Description
Routine MAMME estimates the moving average parameters of an ARMA process based on a system of nonlinear equations given K = MAXLAG autocovariances σ(k) for k = 1, …, K and p = NPAR autoregressive parameters ɸi for i = 1, …, p.
Suppose the time series {Wt} is generated by an ARMA(p,q) model
where p = NPAR and q = NPMA Let
then the autocovariances of the derived moving average process Wt = θ(B)At are given by
where σ(k) denotes the autocovariance function of the original Wt process. The iterative procedure for determining the moving average parameters is based on the relation
Let  = (0, 1, …, q)T and f = (f0, f1, …, fq)T where
and
Then, the value of at the (i + 1)-th iteration is determined by
i+1 = i (T i)1f i
The estimation procedure begins with the initial value
and terminates at iteration i when either f i is less than RELERR or i equals MAXIT. The moving average parameters are determined from the final estimate of by setting θj =  j/ 0 for j = 1, …, q.
The random shock variance is determined according to
In practice, both the autocovariances and the autoregressive parameters are estimated. The solution of the system of nonlinear equations using these sample moments yields the method of moments estimates of the moving average parameters and the random shock variance. Note that autocorrelations ρ(k) may be used instead of autocovariances σ(k) to compute σʹ(k) for k = 1, …, K. See Box and Jenkins (1976, pages 203–204) for additional motivation concerning the initial estimation of moving average parameters using a Newton‑Raphson algorithm.
Comments
1. Workspace may be explicitly provided, if desired, by use of M2MME/DM2MME. The reference is:
CALL M2MME (MAXLAG, ACV, IPRINT, NPAR, PAR, RELERR, MAXIT, NPMA, PMA, PARWK, ACVMOD, TAUINI, TAU, FVEC, FJAC, R, QTF, WKNLN)
The additional arguments are as follows:
PARWK — Work vector of length equal to NPAR + 1.
ACVMOD — Work vector of length equal to NPMA + 1.
TAUINI — Work vector of length equal to NPMA + 1.
TAU — Work vector of length equal to NPMA + 1.
FVEC — Work vector of length equal to NPMA + 1.
FJAC — Work vector of length equal to (NPMA + 1)2.
R — Work vector of length equal to (NPMA + 1) * (NPMA + 2)/2.
QTF — Work vector of length equal to NPMA + 1.
WKNLN — Work vector of length equal to 5 * (NPMA + 1).
2. Informational error
Type
Code
Description
4
1
The nonlinear equation solver did not converge to RELERR within MAXIT iterations.
3. The sample autocovariance function may be computed using the routine ACF.
4. The autoregressive parameter estimates may be computed using the routine ARMME.
Example
Consider the Wölfer Sunspot Data (Box and Jenkins 1976, page 530) consisting of the number of sunspots observed each year from 1770 through 1869. Routine MAMME is invoked to compute the method of moments estimates for the moving average parameter of an ARMA(2,1) model given the sample autocovariances computed from routine ACF and given the estimated autoregressive parameters computed from routine ARMME.
 
USE GDATA_INT
USE ACF_INT
USE ARMME_INT
USE MAMME_INT
 
IMPLICIT NONE
INTEGER IMEAN, IPRINT, ISEOPT, LDX, MAXLAG, NDX, NOBS, &
NOPRIN, NPAR, NPMA
PARAMETER (IMEAN=1, IPRINT=1, ISEOPT=0, LDX=176, MAXLAG=4, &
NDX=2, NOBS=100, NOPRIN=0, NPAR=2, NPMA=1)
!
INTEGER MAXIT, NCOL, NROW
REAL AC(0:MAXLAG), ACV(0:MAXLAG), PAR(2), PMA(1), &
RDATA(LDX,NDX), RELERR, SEAC(1), W(100), WMEAN
!
EQUIVALENCE (W(1), RDATA(22,2))
! 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,1) model
CALL ARMME (MAXLAG, ACV, NPMA, NPAR, PAR)
! Convergence parameters
! Compute estimate of moving average
! parameter for ARMA(2,1) model
CALL MAMME (MAXLAG, ACV, PAR, PMA, IPRINT=IPRINT)
!
END
Output
 
Output PMA from MAMME/M2MME
-0.1241