rlmtest: Robust Lagrange multiplier test for detecting ARCH/GARCH...

Description Usage Arguments Value Author(s) References Examples

View source: R/rlmtest.R

Description

The function performs two resampling techniques to find critical values of the Lagrange multiplier (LM) test, namely permutation and bootstrap, as well as the asymptotic parametric test.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rlmtest(
  y,
  x = NA,
  a.order = 1,
  sig.level = 0.05,
  crit.type = c("asymptotic", "nonparametric"),
  nonp.method = c("bootstrap", "permutation"),
  num.resamp = 1000,
  num.discard = 0
)

Arguments

y

A vector that contains univariate time series observations. Missing values are not allowed.

x

A matrix that contains control variable time series observations. Missing values are not allowed.

a.order

Order of the autoregressive model which must be a nonnegative integer number. Default value 1.

sig.level

Significance level for testing hypothesis of no ARCH effect. Default value is 0.05.

crit.type

Method of obtaining critical values: "asymptotic" (default) or "nonparametric" options.

nonp.method

Type of resampling if crit.type="nonparametric": "bootstrap" (default) or "permutation".

num.resamp

Number of resampling replications if crit.type="nonparametric". Default number is 1,000.

num.discard

Number of bootstrap sample discarded. Default value is 0.

Value

stats

Test statistic.

crit.val

Ressampling based critical value, with a given significance level sig.level.

p.values

p-value of the Lagrange multiplier test.

Author(s)

Meichen Huang, Tian Jiang, Yulia R. Gel

References

Engle R F. Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation[J]. Econometrica: Journal of the econometric society, 1982: 987-1007.

Gel Y R, Chen B. Robust Lagrange multiplier test for detecting ARCH/GARCH effect using permutation and bootstrap[J]. Canadian Journal of Statistics, 2012, 40(3): 405-426.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Collect daily high price (in USD) of Bitcoin and gold from June 1st, 2016 to May 31st, 2021,
and create a dataset with log-returned high price of Bitcoin and gold, named as "GoldBTC".
Test for ARCH effects with log-return of high price of Bitcoin and gold with conditions below:
H0: No ARCH effect.
Ha: There exist ARCH effects.

# Let's import dataset "GoldBTC":
data(GoldBTC)

# Fix seed for reproducible simulations:
set.seed(2021)

# We want to test ARCH effect in Gold.
rlmtest(GoldBTC$Gold, crit.type = "nonparametric",
        nonp.method = "bootstrap")

## The list of returned results are below:
## $stat
## [1] 65.84728
## $crit.val
## 95%
## 1.914901
## $p.value
## [1] 0.003
## Since p-value is 0.003, reject null hypothesis at 0.05,
## that is, ARCH effect exists in gold.

# We want to test for ARCH effects in Bitcoin.
rlmtest(GoldBTC$BTC, crit.type = "nonparametric",
        nonp.method = "bootstrap")

## The list of returned results are below:
## $stat
## [1] 8.189278
## $crit.val
## 95%
## 3.541198
## $p.value
## [1] 0.013
## Since p-value is 0.013, reject null hypothesis at 0.05,
## that is, ARCH effects exist in Bitcoin.

## We want to test ARCH effect in gold and Bitcoin.
rlmtest(GoldBTC$BTC, GoldBTC$Gold, crit.type = "nonparametric",
        nonp.method = "bootstrap")

## The list of returned results are below:
## $stat
## [1] 9.246483
## $crit.val
## 95%
## 3.478484
## $p.value
## [1] 0.015
## Since p-value is 0.015, reject null hypothesis at 0.05,
## that is, ARCH effects exist in Bitcoin controling gold.

gel-research-group/lawstat documentation built on Dec. 20, 2021, 9:50 a.m.