ARMA_SPEC
Calculates the rational power spectrum for an ARMA model. It also computes the rational power spectrum for AR and MA models by setting the number of MA or AR coefficients to zero, respectively.
Required Arguments
PAR — Vector of length NPAR. If NPAR > 0 then PAR contains coefficients for the autoregressive terms in the model. If NPAR = 0, then the contents of PAR are ignored. (Input)
PMA — Vector of length NPMA. If NPMA > 0 then PMA contains the coefficients for the moving‑average terms in the ARMA model. If NPMA = 0 then the contents of PMA are ignored. (Input)
NF — Number of frequencies at which to evaluate the spectral density estimate. NF must be greater than or equal to one. (Input)
AVAR — Estimate of the random shock variance. AVAR must be greater than zero. (Input)
S — Vector of length NF+1 containing the estimated power spectrum. (Output)
Optional Arguments
NPAR — Number of autoregressive (AR) parameters. NPAR must be greater than or equal to zero. (Input)
Default: NPAR=size(PAR).
NPMA — Number of moving‑average (MA) parameters. Must be greater than or equal to zero. (Input)
Default: NPMA= size(PMA).
IPRINT — Printing option. (Input)
Default: IPRINT = 0.
IPRINT
Action
0
No printing
1
Prints final results only
2
Prints intermediate and final results
FORTRAN 90 Interface
Generic: CALL ARMA_SPEC (PAR, PMA, NF, AVAR, S [])
Specific: The specific interface names are S_ARMA_SPEC and D_ARMA_SPEC.
Description
The routine ARMA_SPEC is derived from the rational power spectrum analysis described by Akaike and Nakagawa (1972) and the RASPEC routine published in the original TIMSAC Library.
Using the notation developed in the introduction to this chapter, the stationary time series Wt with mean μ can be represented by the nonseasonal autoregressive moving average model (ARMA) by the following relationship:
where
B is the backward shift operator defined by ,
and
Routine ARMA_SPEC uses estimates for the coefficients ɸ1, ɸ2, , ɸNPAR, and Θ 1, Θ 2, , Θ NPMA as input to its algorithm, PAR and PMA respectively. These estimates can be derived from MAX_ARMA or by using NSLSE.
Routine ARMA_SPEC also requires an initial estimate for the variance of the white noise in the series. In MAX_ARMA this is returned as AVAR. This is also returned from the autocovariance procedure ACF as ACV(0).
Example
Consider the Wolfer Sunspot Data (Box and Jenkins 1976, page 530) consisting of the number of sunspots observed each year from 1770 through 1869. These data can be modeled using the following model [ARMA(NPAR=2, NPMA=1)]
In this example, estimates of the coeffiecients in this model are obtained using MAX_ARMA. These are then sent to ARMA_SPEC to obtain the estimated power spectrum.
 
USE GDATA_INT
USE ARMA_SPEC_INT
USE MAX_ARMA_INT
USE WRRRN_INT
 
IMPLICIT NONE
INTEGER, PARAMETER :: NF=20, LDX=176, NDX=2
INTEGER NCOL, NROW
REAL(KIND(1E0)) PAR(2), PMA(1), RDATA(LDX,NDX), &
W(100), S(0:NF), AVAR
EQUIVALENCE (W(1), RDATA(22,2))
DATA PAR/-0.5783E0, 0.18594E0/
DATA PMA/-0.1E0/
 
! Wolfer Sunspot Data for
! years 1770 through 1869
CALL GDATA (2, RDATA, NROW, NCOL)
CALL MAX_ARMA(W, PAR, PMA, AVAR=AVAR)
CALL ARMA_SPEC(PAR, PMA, NF, AVAR, S)
CALL WRRRN("S", S)
END
Output
 
S
1 714.8
2 786.7
3 1030.2
4 1450.4
5 1619.6
6 1146.4
7 670.4
8 407.2
9 269.3
10 192.3
11 146.2
12 116.7
13 96.9
14 83.2
15 73.4
16 66.3
17 61.3
18 57.7
19 55.3
20 53.9
21 53.5
Published date: 03/19/2020
Last modified date: 03/19/2020