forked from statmlhb/CVEK
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtesting.Rd
98 lines (77 loc) · 3.07 KB
/
testing.Rd
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/testing.R
\name{testing}
\alias{testing}
\title{Conducting Score Tests for Interaction}
\usage{
testing(Y, X, K_list, K_int, mode = "loocv", strategy = "stack",
beta_exp = 1, test = "boot", lambda = exp(seq(-10, 5)), B = 100)
}
\arguments{
\item{Y}{(vector of length n) Reponses of the dataframe.}
\item{X}{(dataframe, n*p) Fixed effects variables in the dataframe (could
contains several subfactors).}
\item{K_list}{(list of matrices) A nested list of kernel term matrices.
The first level corresponds to each base kernel function in kern_func_list,
the second level corresponds to each kernel term specified in the formula.}
\item{K_int}{(matrix, n*n) The kernel matrix to be tested.}
\item{mode}{(character) A character string indicating which tuning parameter
criteria is to be used.}
\item{strategy}{(character) A character string indicating which ensemble
strategy is to be used.}
\item{beta_exp}{(numeric/character) A numeric value specifying the parameter
when strategy = "exp" \code{\link{ensemble_exp}}.}
\item{test}{(character) A character string indicating which test is to be
used.}
\item{lambda}{(numeric) A numeric string specifying the range of tuning parameter
to be chosen. The lower limit of lambda must be above 0.}
\item{B}{(integer) A numeric value indicating times of resampling when test
= "boot".}
}
\value{
\item{pvalue}{(numeric) p-value of the test.}
\item{lambda}{(numeric) The selected tuning parameter based on the estimated
ensemble kernel matrix.} \item{u_hat}{(vector of length K) A vector of
weights of the kernels in the library.}
}
\description{
Conduct score tests comparing a fitted model and a more general alternative
model.
}
\details{
There are two tests available here:
\bold{Asymptotic Test}
This is based on the classical variance component test to construct a
testing procedure for the hypothesis about Gaussian process function.
\bold{Bootstrap Test}
When it comes to small sample size, we can use bootstrap test instead, which
can give valid tests with moderate sample sizes and requires similar
computational effort to a permutation test.
}
\examples{
rbf_kern_func <- generate_kernel(method = "rbf", l = 1.25)
K_int <- parse_kernel_terms(y ~ k(x1):k(x3, x4):x2, rbf_kern_func, dora)
testing(Y = CVEK:::model_matrices$y, X = CVEK:::model_matrices$X,
K_list = CVEK:::model_matrices$K, K_int = K_int[[1]],
mode = "loocv", strategy = "stack",
beta_exp = 1, test = "boot", lambda = exp(seq(-10, 5)),
B = 100)
}
\references{
Xihong Lin. Variance component testing in generalised linear
models with random effects. June 1997.
Arnab Maity and Xihong Lin. Powerful tests for detecting a gene effect in
the presence of possible gene-gene interactions using garrote kernel
machines. December 2011.
Petra Bu ̊zˇkova ́, Thomas Lumley, and Kenneth Rice. Permutation and
parametric bootstrap tests for gene-gene and gene-environment interactions.
January 2011.
}
\seealso{
method: \code{\link{generate_kernel}}
mode: \code{\link{tuning}}
strategy: \code{\link{ensemble}}
}
\author{
Wenying Deng
}