AUTO_MUL_AR
Automatic selection and fitting of a multivariate autoregressive time series model. This is the multivariate version of AUTO_UNI_AR. The lag for the model is automatically selected using Akaike’s Information Criterion (AIC).
Required Arguments
X — NOBS by NCHANX matrix containing the stationary multivariate time series. (Input)
Each row of X corresponds to an observation of a multivariate time series, and each column of X corresponds to a univariate time series.
MAXLAG — Maximum number of autoregressive parameters requested. (Input)
NMATRIX — Number of autoregressive parameter matrices in the minimum AIC model. (Output)
PAR — Three dimensional NMATRIX by NCHANX by NCHANX array containing estimates for the autoregressive parameters in the model. (Output)
Optional Arguments
NOBS — Number of observations in each time series.
Default: NOBS = size(X,1) (Input)
NCHANX — Number of variables, channels, in the multivariate time series. (Input)
NCHANX is the number of columns in X that should be processed. Default: NCHANX = size(X,2)
IPRINT — Printing option. (Input)
0 |
No printing |
1 |
Prints final results only |
2 |
Prints intermediate and final results |
Default: IPRINT = 0
AVAR — NCHANX by NCHANX array of estimates of the noise variance. (Output)
NPAR — Vector of length NCHANX containing the number of autoregressive parameters fitted for each time series. (Output)
AIC — Akaike’s Information Criterion . (Output)
FORTRAN 90 Interface
Generic: CALL AUTO_MUL_AR (X, MAXLAG, NMATRIX, PAR [, …])
Specific: The specific interface names are S_AUTO_MUL_AR and D_AUTO_MUL_AR.
Description
The routine AUTO_MUL_AR automatically selects the order of the multivariate AR model that best fits the data and then displays the AR coefficients. This procedure is an adaptation of the MULMAR procedure published in the TIMSAC‑78 Library by Akaike, H., et. al (1979) and Kitagawa & Akaike (1978).
A multivariate AR model can be expressed as:
where
is a column vector containing the values for the NCHANX univariate time series at time = t.
are the NCHANX by NCHANX matrices containing the autoregressive parameter estimates for lags 1, 2, …, NMATRIX. And
is a column vector containing the values for the NCHANX white noise values for each time series at time = t.
The best fit AR model is determined by successfully fitting multivariate AR models with 1 to NMATRIX autoregressive coefficients. For each model, Akaike’s Information Criterion (AIC) is calculated using the formula:
where
K = number of non‑zero autoregressive coefficients in the parameter matrices.
The best fit model is the model with the minimum AIC. If the number of parameters in this model is equal to the highest order autoregressive model fitted, i.e., NMATRIX=MAXLAG, then a model with smaller AIC might exist for larger values of MAXLAG. In this case, increasing MAXLAG to explore AR models with additional autoregressive parameters might be warranted.
Example
Consider the data in northern light activity and earthquakes in Robinson 1967, page 204, for the years 1770 through 1869.
USE GDATA_INT
USE AUTO_MUL_AR_INT
USE WRRRN_INT
IMPLICIT NONE
INTEGER, PARAMETER :: NOBS=100, MAXLAG=10
INTEGER NCOL, NROW, NMATRIX, I
REAL(KIND(1E0)) RDATA(NOBS,4), X(NOBS,3), PAR(MAXLAG,3,3)
CALL GDATA, RDATA, NROW, NCOL)
X(:,1) = Rdata(:,3)
X(:,2) = Rdata(:,4)
X(:,3) = Rdata(:,2)
CALL AUTO_MUL_AR(X,MAXLAG,NMATRIX,PAR)
WRITE(*,*) "PAR = "
DO I=1,NMATRIX
CALL WRRRN("",PAR(I,:,:))
ENDDO
END
Output
PAR =
1 2 3
1 0.822 0.000 0.000
2 0.000 0.000 -0.290
3 0.098 0.000 1.214
1 2 3
1 -0.1136 0.0000 0.0000
2 0.2489 0.0000 0.0000
3 0.0040 0.0000 -0.8682
1 2 3
1 0.0000 0.0000 0.0000
2 0.0000 0.0000 0.0000
3 0.0725 0.0000 0.3374
1 2 3
1 0.0000 0.0000 0.0000
2 0.0000 0.0000 0.0000
3 -0.0693 0.0400 -0.2217
1 2 3
1 0.0000 0.0000 0.0000
2 0.0000 0.0000 0.0000
3 0.0745 -0.0025 0.1253
1 2 3
1 0.0000 0.0000 0.0000
2 0.0000 0.0000 0.0000
3 -0.0299 0.0510 -0.1570
1 2 3
1 0.00000 0.00000 0.00000
2 0.00000 0.00000 0.00000
3 0.00806 0.05025 0.04558
1 2 3
1 0.00000 0.00000 0.00000
2 0.00000 0.00000 0.00000
3 0.03858 0.01929 -0.09825
1 2 3
1 0.0000 0.0000 0.0000
2 0.0000 0.0000 0.0000
3 0.0904 -0.0154 0.1376
1 2 3
1 0.00000 0.00000 0.00000
2 0.00000 0.00000 0.00000
3 0.00000 -0.06879 0.00000