cv_WAPL: WAPL with CV This is based on WAPL, and uses cross validation...

Description Usage

View source: R/cv_WAPL.R

Description

WAPL with CV This is based on WAPL, and uses cross validation to tune the hyper-parameter lambda and number of basis @param H, n by p Covariate matrix @param A, Treatment assigned, length n vector @param R2, Residual or the original outcome @param prop: Pr(A|H) the propensity score, assumed to be known. @param pentype: Penalty type used for residual calculation, default is lasso, otherwise LSE is used @param m: m-fold cross validation for choosing the tunning parameter lambda @param group: Group information, should be consective, default is NULL i.e. no group information presents @param plist: Candidate value of number of basis, default is c(3:10) @param lambda: A user supplied lambda sequence(ordered in decreasing value). Normally set it to null so the computing algorithm calculate it automatically. @param nlambda: number of lambda, default is 50 @param lambda.min.ratio: the ration between max lambda and minimal lambda @param thol: Stopping precision. The default value is 1e-5. @param mu: Smoothing parameter used in approximate the Hinge Loss. The default value is 0.05. @param max.ite: The number of maximum iterations. The default value is 1e5 @import gglasso @import glmnet @export @examples train.data <- gSim(N=200, sigma=0, scenario=1) H <- train.data[[1]] A <- train.data[[2]] R2 <- train.data[[3]] group=rep(1:20, each=3) tst = cv_WAPL(H, A, R2 , prop=rep(1,200), pentype = "lasso",lambda.min.ratio=0.2, m=7, group= group, plist=c(3:5))

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
cv_WAPL(
  H,
  A,
  R2,
  prop = rep(1, n),
  pentype = "lasso",
  m = 10,
  group = NULL,
  plist = c(3:10),
  lambda = NULL,
  nlambda = 50,
  lambda.min.ratio = 0.2,
  thol = 1e-05,
  mu = 0.05,
  max.ite = 1e+05
)

sambiostat/WAPL documentation built on May 26, 2020, 12:17 a.m.