calulate.mu_Xk: Calculate mu(Xk) where Xk denotes the null sample

Description Usage Arguments Value References See Also

View source: R/method.R

Description

This function calculates mu(Xk) for null replicates Xk.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
calulate.mu_Xk(
  binary = FALSE,
  X,
  i2,
  S,
  out,
  nulls.list_S = NULL,
  gamma_X.list_S = NULL,
  useMC = TRUE,
  Xmodel = "gaussian",
  algo = "lasso",
  predict.fun,
  cv.rule = "min",
  verbose = FALSE
)

Arguments

binary

whether the response variable is binary (will be converted to factors if TRUE; default: FALSE).

X

a n by p matrix, containing all the covariates.

i2

the index of inference samples.

S

a list of selected variables.

out

the fitted model from train.fun.

nulls.list_S

a list of length |S| whose element is a (|i2|*K)-dimensional vector, which contains K set of null samples.

gamma_X.list_S

a list of length |S|, with each element being the linear coefficient of the given covariate on the other covariates (only relevant when Xmodel = "gaussian"; default: NULL).

useMC

whether to use Monte Carlo estimators of the conditional quantities (default: TRUE).

Xmodel

model of the covaraites (default: "gaussian").

algo

a fitting algorithm (default: "lasso").

predict.fun

a function to produce predictions of the response variable with a given fitted model from train.fun and a matrix of new covariate values.

cv.rule

indicates which rule should be used for the predict function, either "min" (the usual rule) or "1se" (the one-standard- error rule); default: "min"). See the glmnet help files for details.

verbose

whether to show intermediate progress (default: FALSE).

Value

A list of kength |S|, whose element is the matrix of mu(Xk) with dimension n2-by-K or n2-by-1.

References

\insertRef

LZ-LJ:2020floodgate

See Also

Other methods: calculate.V_mean(), fg.inference.binary(), fg.inference(), fit.mu(), floodgate.binary(), floodgate(), inference_general()


LuZhangH/floodgate documentation built on Aug. 30, 2020, 2:10 a.m.