NSPE
Computes preliminary estimates of the autoregressive and moving average parameters of an ARMA model.
Required Arguments
W — Vector of length NOBS containing the stationary time series. (Input)
CNST — Estimate of the overall constant. (Output)
PAR — Vector of length NPAR containing the autoregressive parameter estimates. (Output)
PMA — Vector of length NPMA containing the moving average parameter estimates. (Output)
AVAR — Estimate of the random shock variance. (Output)
Optional Arguments
NOBS — Number of observations in the stationary time series W. (Input)
NOBS must be greater than NPAR + NPMA + 1.
Default: NOBS = size (W,1).
IPRINT — Printing option. (Input)
Default: IPRINT = 0.
IPRINT |
Action |
0 |
No printing is performed. |
1 |
Prints the mean of the time series, the estimate of the overall constant, the estimates of the autoregressive parameters, the estimates of the moving average parameters, and the estimate of the random shock variance. |
IMEAN — Option for centering the time series X. (Input)
Default: IMEAN = 1
IMEAN |
Action |
0 |
WMEAN is user specified. |
1 |
WMEAN is set to the arithmetic mean of X. |
WMEAN — Constant used to center the time series X. (Input, if IMEAN = 0; output,
if IMEAN = 1)
Default: WMEAN = 0.0.
NPAR — Number of autoregressive parameters. (Input)
NPAR must be greater than or equal to zero.
Default: NPAR = size (PAR,1).
NPMA — Number of moving average parameters. (Input)
NPMA must be greater than or equal to zero.
Default: NPMA = size (PMA,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.
FORTRAN 90 Interface
Generic: CALL NSPE (W, CNST, PAR, PMA, AVAR [, …])
Specific: The specific interface names are S_NSPE and D_NSPE.
FORTRAN 77 Interface
Single: CALL NSPE (NOBS, W, IPRINT, IMEAN, WMEAN, NPAR, NPMA, RELERR, MAXIT, CNST, PAR, PMA, AVAR)
Double: The double precision name is DNSPE.
Description
Routine NSPE computes preliminary estimates of the parameters of an ARMA process given a sample of n = NOBS observations {Wt} for t = 1, 2, …, n.
Suppose the time series {Wt} is generated by an ARMA(p,q) model of the form
ɸ(B)Wt= θ0 + θ(B)At t ∈ {0, ±1, ±2, …}
where B is the backward shift operator,
ɸ(B) = 1 − ɸ1(B) − ɸ2(B)2 − … − ɸp(B)p
θ (B) = 1 − θ1(B) − θ2(B)2 − … − θq(B)q
p = NPAR and q = NPMA. Let
be the estimate of the mean of the time series {Wt} where
The autocovariance function σ(k) is estimated by
where K = p + q. Note that
is an estimate of the sample variance.
Given the sample autocovariances, the routine ARMME is used to compute the method of moments estimates of the autoregressive parameters using the extended Yule‑Walker equations
where
The overall constant θ0 is estimated by
The moving average parameters are estimated using the routine MAMME. Let
then the autocovariances of the derived moving average process
are estimated by
The iterative procedure for determining the moving average parameters is based on the relation
where σ(k) denotes the autocovariance function of the original Wt process.
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
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 parameter estimates are obtained from the final estimate of by setting
The random shock variance is estimated by
See Box and Jenkins (1976, pages 498–500) for a description of a similar routine.
Comments
1. Workspace may be explicitly provided, if desired, by use of N2PE/DN2PE. The reference is:
CALL N2PE (NOBS, W, IPRINT, IMEAN, WMEAN, NPAR, NPMA, RELERR, MAXIT, CONST, PAR, PMA, AVAR, ACV, PARWK, AVCMOD, TAUINI, TAU, FVEC, FJAC, R, QTF, WKNLN, A, FAC, IPVT, WKARMM)
The additional arguments are as follows:
ACV — Work vector of length equal to NPAR + NPMA + 1.
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).
A — Work vector of length equal to NPAR2.
FAC — Work vector of length equal to NPAR2.
IPVT — Work vector of length equal to NPAR.
WKARMM — Work vector of length equal to NPAR.
2. Informational error
Type |
Code |
Description |
4 |
1 |
The nonlinear equation solver did not converge to RELERR within MAXIT iterations. |
3. The value of WMEAN is used in the computation of the sample autocovariances of W in the process of obtaining the preliminary autoregressive parameter estimates. Also, WMEAN is used to obtain the value of CNST.
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 NSPE is used to compute preliminary estimates
for the following ARMA (2, 1) model
where the errors At are independently distributed each normal with mean zero and variance .
USE GDATA_INT
USE NSPE_INT
IMPLICIT NONE
INTEGER IPRINT, LDX, NDX, NOBS, NOPRIN, NPAR, NPMA
PARAMETER (IPRINT=1, LDX=176, NDX=2, NOBS=100, NOPRIN=0, NPAR=2, &
NPMA=1)
!
INTEGER IMEAN, MAXIT, NCOL, NROW
REAL AVAR, CNST, PAR(NPAR), PMA(NPMA), RDATA(LDX,NDX), &
RELERR, W(NOBS), WMEAN
!
EQUIVALENCE (W(1), RDATA(22,2))
! Wolfer Sunspot Data for
! years 1770 through 1869
CALL GDATA (2, RDATA, NROW, NCOL )
! USE Default Convergence parameters
! Compute preliminary parameter
! estimates for ARMA(2,1) model
CALL NSPE (W, CNST, PAR, PMA, AVAR, IPRINT=IPRINT)
!
END
Output
Results from NSPE/N2PE
WMEAN = 46.9760
CONST = 15.5440
AVAR = 287.242
PAR
1 2
1.244 -0.575
PMA
-0.1241