MartG_test | R Documentation |
MartG_test()
implements a new test proposed in
Chang, Jiang and Shao (2021) for the following hypothesis testing problem:
H_0:\{{\bf x}_t\}_{t=1}^n\mathrm{\ is\ a\ MDS\ \ versus\ \ }H_1:
\{{\bf x}_t\}_{t=1}^n\mathrm{\ is\ not\ a\ MDS,}
where MDS is the abbreviation of "martingale difference sequence".
MartG_test(
X,
lag.k = 2,
B = 1000,
type = c("Linear", "Quad"),
alpha = 0.05,
kernel.type = c("QS", "Par", "Bart")
)
X |
|
lag.k |
Time lag |
B |
Bootstrap times for generating multivariate normal distributed
random vectors in calculating the critical value.
Default is |
type |
String, a map is chosen by the R users, such as the
default option is |
alpha |
The prescribed significance level. Default is 0.05. |
kernel.type |
String, an option for choosing the symmetric kernel
used in the estimation of long-run covariance matrix,
for example, |
An object of class "hdtstest" is a list containing the following components:
.
statistic |
The value of the test statistic. |
p.value |
Numerical value which represents the p-value of the test. |
lag.k |
The time lag used in function. |
method |
A character string indicating what method was performed. |
type |
A character string which map used on data matrix |
kernel.type |
A character string indicating what kenel method was performed. |
Chang, J., Jiang, Q. & Shao, X. (2022). Testing the martingale difference hypothesis in high dimension. Journal of Econometrics, in press
n <- 200
p <- 10
X <- matrix(rnorm(n*p),n,p)
res <- MartG_test(X, type="Linear")
res <- MartG_test(X, type=cbind(X, X^2)) #the same as Linear type
res <- MartG_test(X, type=quote(cbind(X, X^2))) # expr using quote
res <- MartG_test(X, type=substitute(cbind(X, X^2))) # expr using substitute
res <- MartG_test(X, type=expression(cbind(X, X^2))) # expr using expression
res <- MartG_test(X, type=parse(text="cbind(X, X^2)")) # expr using parse
map_fun <- function(X) {X <- cbind(X,X^2); X}
res <- MartG_test(X, type=map_fun)
Pvalue <- res$p.value
rej <- res$reject
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.