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: annarchtest

Quantlet: archtest
Description: This quantlet calculates either the Lagrange Multiplier (LM) form or the R squared (TR2) form of Engle's ARCH test. The first argument of the function is the vector of residuals, the second optional argument is the lag order of the test. This ; second argument may be either a scalar, or a vector. In the later case, the test is evaluated for all the order components of the vector. If this second optional argument is not provided, the default lag orders are 2, 3, 4, and 5. The third optional argument is the form of the test. This argument is a string, which can be either "LM" or "TR2". The default third argument is "LM", i,e., the LM form. The quantlet returns in the first column the order of the test, in the second column the value of the test, in the third column the 95% critical value of the null hypothesis for that order, and in the fourth column the P-value of the test.

Reference(s):

Usage: h = archtest(y {,lags{,testform}})
Input:
y vector
lags vector
testform string
Output:
h vector of strings

Example:
library("times")
randomize(0)
y = genarch(0.2|0.1,0.5,200)
h = archtest(y)
h

Result:
As no optional argument is provided, the Lagrange Multiplier
form of the statistic is evaluated for the default lag
orders 2,3,4, and 5.

Contents of h

[1,] Lag order  Statistic  95% Critical Value  P-Value
[2,] __________________________________________________
[3,]
[4,]      2      3.36892         5.97378       0.18551
[5,]      3     16.40116         7.80251       0.00094
[6,]      4     16.79456         9.47844       0.00212
[7,]      5     17.53251        11.06309       0.00359
Example:
;Calculation of the TR2 form of the ARCH test for the default
;lag orders 2,3,4, and 5.
library("times")
randomize(0)
y = genarch(0.2|0.1,0.5,200)
h = archtest(y,"TR2")
h

Result:
Contents of h

[1,] Lag order  Statistic  95% Critical Value  P-Value
[2,] __________________________________________________
[3,]
[4,]      2      2.53583         5.97378       0.28139
[5,]      3     12.14567         7.80251       0.00690
[6,]      4     12.42151         9.47844       0.01448
[7,]      5     13.02704        11.06309       0.02313
Example:
Calculation of the TR2 form of the ARCH test for the lag
orders 3,5,7,8
library("times")
randomize(0)
y = genarch(0.2|0.1,0.5,200)
k = #(3,5,7,8)
h = archtest(y,k,"TR2")
h

Result:
Contents of h

[1,] Lag order  Statistic  95% Critical Value  P-Value
[2,] __________________________________________________
[3,]
[4,]      3     12.14567         7.80251       0.00690
[5,]      5     13.02704        11.06309       0.02313
[6,]      7     14.13459        14.06200       0.04884
[7,]      8     13.80119        15.50292       0.08710
Example:
Calculation of the LM form of the ARCH test for the lag
orders 3,5,7,8
library("times")
randomize(0)
y = genarch(0.2|0.1,0.5,200)
k = #(3,5,7,8)
h = archtest(y,k)
; h = archtest(y,k,"LM") ; this is an equivalent instruction
h

Result:
Contents of h

   [1,] Lag order  Statistic  95% Critical Value  P-Value
   [2,] __________________________________________________
   [3,]
   [4,]      3     16.40116         7.80251       0.00094
   [5,]      5     17.53251        11.06309       0.00359
   [6,]      7     19.22952        14.06200       0.00750
   [7,]      8     18.65397        15.50292       0.01682



Author: G. Teyssiere, 19980531 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006