Automatic selection and fitting of a univariate autoregressive time series model using Akaike’s Final Prediction Error (FPE) criteria. Estimates of the autoregressive parameters for the model with minimum FPE are calculated using the methodology described in Akaike, H., et. al (1979).
Required Arguments
MAXLAG — Maximum lag of the sample autocovariances for the stationary time series, W. (Input)
ACV — Vector of length MAXLAG + 1 containing the sample autocovariances of W. The first element, ACV(0) must be the sample variance of the series and the remaining elements, ACV(1), …, ACV(MAXLAG), contain the autocovariances of the series for lags 1 through MAXLAG. (Input)
NOBS — Number of observations in the time series. (Input)
NPAR — Number of autoregressive parameters in the the selected model. (Output)
PAR — Vector of length MAXLAG containing estimates for the autoregressive parameters in the model with the minimum Final Prediction Error. The estimates are in the first NPAR values of this vector. The remaining values are set to 0. (Output)
Optional Arguments
IPRINT — Printing option. (Input)
0
No printing
1
Prints final results only
2
Prints intermediate and final results
Default: IPRINT = 0.
FPE — Final Prediction Error for fitted model. (Output)
CHISQ — Chi‑square statistic, with 1 degree of freedom, for the selected model. CHISQ is used to examine the significance of the fitted model. (Output)
Specific: The specific interface names are S_AUTO_FPE_UNI_AR and D_AUTO_FPE_UNI_AR.
Description
This routine is based upon the FPEAUT program published in the TIMSAC –71 Library described by Akaike, H. and Nakagawa, T (1972).
The Final Prediction Error for an autoregressive model with lag k is defined as:
where N = NOBS and is the minimum of
with respect to the autoregressive coefficients
is estimated using the formula:
where is calculated from the recursive relationship:
The model selected and parameter estimates vary depending upon the value of MAXLAG. Akaike and Nakagawa (1972) recommend that MAXLAG start with values between and .
In every case, however, MAXLAG must be strictly less than .
As MAXLAG is increased numerical accuracy decreases. It is even possible numerically for the estimated FPE to become negative. If this happens, use double precision.
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. In this example, AUTO_FPE_UNI_AR, found the minimum FPE solution is an autoregressive model with 10 lags. This is slightly different from the optimum solution found by AUTO_UNI_AR, using minimum AIC instead of FPE.
The solution reported by AUTO_UNI_AR is an AR model with 2 lags.
Using the formula
we obtain the following representation for this series.
use auto_fpe_uni_ar_int
use wrrrn_int
use gdata_int
use acf_int
implicit none
! SPECIFICATIONS FOR PARAMETERS
integer, parameter :: maxlag=20, nobs=100
integer :: npar
real(kind(1e0)) :: fpe, chisq
real(kind(1e0)) :: ac(maxlag+1), avar
real(kind(1e0)) :: acv(maxlag+1), par(maxlag)
real(kind(1e0)) :: x(176,2)
integer :: ncol, nrow
!
! Get Wolfer Sunspot Data
call gdata(2,x,nrow,ncol)
!
npar = 20
write(*,*) 'Univariate FPE Automatic Order selection '