mmdlmspec.b_test: MMD Specification Test

View source: R/dCovReg.R

mmdlmspec.b_testR Documentation

MMD Specification Test

Description

mmdlmspec.b_test conducts the Su \& Zheng 2017 specification test on a linear model estimated with the MMD estimator. It is based on the wild bootstrap.

Usage

mmdlmspec.b_test(mmd.Obj, B = 199, wmat = NULL, cl = NULL, cluster = NULL)

Arguments

mmd.Obj

is an MMD regression output from mmdreg.fit()

B

number of wild bootstrap samples. Defaults to 199

wmat

in case the n x B matrix of wild bootstrap weights are supplied by the user.

cl

an integer to indicate number of child-processes in pbapply::pbsapply().

cluster

vector of length n with cluster ids if cluster-robust wild-bootstrap is used

Value

the p-value, test statistic,

Examples

## Generate data and run MMD regression
n=100; set.seed(12); X = rnorm(n); er = rchisq(n,df=1)-1; Z=X; X=scale(abs(X))+er/sqrt(2)
Y=X+er; reg1 = mmdreg.fit(Y,X,Z); reg2 = mmdreg.fit(Y,X,X) #run regression
mmdlmspec.b_test(reg1); mmdlmspec.b_test(reg2) #test under the null and the alternative
## MMD coefficients, standard errors, and t-statistics


estsyawo/bayesprdopt documentation built on April 2, 2024, 2:18 p.m.