Learn R Programming

DTRlearn (version 1.0)

Olearning_Single: Single stage improved O-learning

Description

Improved outcome weighted learning, first take residuals; and then use cross validation to choose best tuninng parameter for wsvm. Return the O-learning models with best tuning parameters.

Usage

Olearning_Single(H,A,R2,pi=rep(1, n),pentype ="lasso",kernel="linear",
sigma = c(0.03, 0.05, 0.07),clinear = 2^(-2:2), m = 4,e = 1e-05)

Arguments

H
a n by p matrix, n is the sample size, p is the number of feature variables.
A
a vector of n entries coded 1 and -1 for the treatment assignments
R2
The vector of outcome variable, larger is more desirable.
pi
The vector of randomization probability $P(A|X)$, or the estimated observed probability.
pentype
The regression used to take residual, 'lasso' is the default, using lasso regression; 'LSE' is the ordianry least square.
kernel
Kernel function for weighted SVM, can be 'linear' or 'rbf' (radial basis kernel), default is 'linear'. When 'rbf' is specified, one can specify the sigma parameter for radial basis kernel.
sigma
A grid of tuning parameter for 'rbf' kernal for cross validation, when kernel='rbf', the default is $c(0.03, 0.05, 0.07)$
clinear
a grid of tuning parameter C for cross validation,the default is $2^(-2:2)$. C is tuning parameter as defined in wsvm
m
Folds of cross validation. the training and test ratio is (m-1):1.
e
The rounding

Value

  • modelA Class of

References

Zhao, Y., Zeng, D., Rush, A. J., & Kosorok, M. R. (2012). Estimating individualized treatment rules using outcome weighted learning. Journal of the American Statistical Association, 107(499), 1106-1118.

See Also

Olearning

Examples

Run this code
n_cluster=5
pinfo=10
pnoise=10
n_sample=50
set.seed(3)
example=make_classification(n_cluster,pinfo,pnoise,n_sample)
pi=list()
pi[[2]]=pi[[1]]=rep(1,n_sample)
modelrbf=Olearning_Single(example$X,example$A,example$R,kernel='rbf',m=3,sigma=0.05)
modellinear=Olearning_Single(example$X,example$A,example$R)

Run the code above in your browser using DataLab