Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: times
See also: ar1res armacls armalik arimacls arima11 arimaf

Quantlet: ariols
Description: Estimation of the ARI(p,d) process by OLS and diagnostics. Residuals diagnostics include their timeplot with two-standard error bounds, correlograms and Ljung-Box statistics with p-values. Parameter diagnostics include their t-statistics with p-values and variance-covariance matrix. Computed model selection criteria are AIC and BIC.

Reference(s):

Usage: A = ariols(y,p,d,const{,rcheck{,pcheck{,msc}}})
Input:
y input series length n
p integer, order of autorregresive process
d integer, order of differences
const string, a constant is calculated if const = "constant"
rcheck optional string, residual diagnostic checking, if rcheck = "rcheck", residual diagnostics are calculated and plots of the residuals and the corresponding correlograms are displayed, if rcheck = "prcheck", the plots are omitted
pcheck optional string, parameter diagnostic statistics are computed if pcheck = "pcheck"
msc optional string, if msc = "msc" model selection criteria are computed
Output:
A.b estimated coefficients. If const = "constant", the first element represents the constant term.
A.bst asymptotic standard deviations of estimated parameters.
A.wnv estimated variance of the innovations.
A.checkr if rcheck="prcheck", list containing the residual diagnostics: 1. res = n-p x 1 vector of residuals (i.e., one step ahead prediction errors computed with estimated parameters), 2. stat = scalar with statistic for testing H0: zero mean innovations (asymptotically normal under H0) and 3. acfQ = 30 x 4 matrix with the residuals acf, Ljung-Box statistic with p-values and pacf. The p-values are computed for M>p, and the first p values are filled with zeros. If rcheck="rcheck", the output contains all of the above mentioned residual diagnostics and plots additionally the residuals and their acf and pacf (correlograms). Otherwise, checkr=list containing the residuals.
A.checkp if pcheck="pcheck", list containing the parameter diagnostics: 1. est = string that informs if the necessary stationary condition (phi1+phi2+...+phip) holds or not. If the estimated values are stationary, it takes value 0. 2. bt = p x 2 or 1+p x 2 matrix of t-statistics and p-values (asymp. normal) for testing parameter significance and 3. bvar = variance covariance matrix of parameter estimates. Otherwise, checkp=0.
A.ic if msc="msc", 2 x 1 vector containing two model selection criteria: the Akaike Information Criterion, AIC, and the Schwarz Information Criterion, SIC. Otherwise, ic = 0.

Example:
; Example 1: zero mean process; estimation and parameter diagnostics
library("times")             ; loads the quantlets from times library
randomize(33)                ; sets the seed
b = #(0.5,-0.3)              ; AR coefficients
y = genarma(b,0,normal(300)) ; generates AR(2) series
ar2 = ariols(y,2,0,"noconstant","0","pcheck")
ar2.checkp.est               ; informs if the process is stationary
ar2.b                        ; estimated AR coefficients
ar2.checkp.bvar              ; covariance matrix for estimated coefficients
ar2.checkp.bt                ; t- and p-values for estimated coefficients
ar2.wnv                      ; estimated variance of the innovations
ar2.checkr.res[1]            ; first residual

Result:
Contents of est
[1,] "0"

Contents of b
[1,]  0.51878
[2,] -0.23496

Contents of bvar
[1,]  0.0031933 -0.0013434
[2,] -0.0013434  0.0031972

Contents of bt
[1,]   9.1804  5.421e-20
[2,]  -4.1554  3.2468e-05

Contents of wnv
[1,]	1.0518

Contents of _tmp
[1,] -0.065255      ; first residual
Example:
; Example 2: nonzero mean process; estimation, residual diagnostics and model selection criteria
library("times")                    ; loads the quantlets from times library
randomize(33)                       ; sets the seed
b = #(0.5,-0.3)                     ; AR coefficients
y = genarma(b,0,normal(300)) + 0.5  ; generates AR(2) series
ar2 = ariols(y,2,0,"constant","prcheck","0","msc")
ar2.b                               ; estimated AR coefficients
ar2.wnv                             ; estimated variance of the innovations
ar2.checkr.acfQ[15,2]               ; Ljung-Box with M=15
ar2.ic                              ; AIC and BIC

Result:
Contents of b
[1,]  0.32307
[2,]  0.51796
[3,] -0.23599

Contents of wnv
[1,]   1.0541

Contents of _tmp
[1,]   7.3197

Contents of ic
[1,]   0.055948
[2,]   0.080761



Author: P. Moral, P. González, 20020724
(C) MD*TECH Method and Data Technologies, 05.02.2006