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 |
{\bf X} = \{{\bf x}_1, … , {\bf x}_n \}', an n\times p sample matrix, where n is the sample size and p is the dimension of {\bf x}_t. |
lag.k |
Time lag K, a positive integer, used to calculate the test
statistic. Default is |
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 "MartG_test" is a list containing the following components:
reject |
Logical value. If |
p.value |
Numerical value which represents the p-value of the test. |
Chang, J., Jiang, Q. & Shao, X. (2021). Testing the martingale difference hypothesis in high dimension.
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.