Description Usage Arguments Details Value Author(s) Examples
Fit alternative individualized treatment recommendation (A-ITR) or ITR given a loss function and a kernel.
1 |
x |
a data frame or a matrix. |
a |
a factor or an integer vector indicating the treatment assigned to patients. |
y |
a numeric vector indicating the outcome after taking the treatment. |
p |
a numeric vector with each element between 0 to 1, indicating the probability of the treatment been assigned to the patient. |
c |
a numeric value no less than 1, indicating the bent slope of the loss. |
method |
the method to be used. Must be one of |
kernel |
kernel type to be used. Currently only |
epsilon |
a positive numeric value used only when |
d |
a positive integer used only when |
lambda |
a numeric vector indicating the penalty for tunning. |
cv |
logical. If |
tunning |
logical. If |
This function fits an individualized treatment recommendation under a bent loss. The bent slope is controled by the parameter c. When c = 1
, it degenerates to the traditional ITR fit. For the purpose of saving computation time, it is suggested to set cv = TRUE
for bent svm loss and cv = FALSE
for other bent losses. It is also suggested to set tunning = TRUE
for fitting A-ITR.
itrFit
returns an object of class c("itrfit.svm", "itrfit")
or c("itrfit.dif", "itrfit")
. An object of class "itrfit"
is a list containing at least the following components:
obj_value |
the expected outcome under the traditional ITR. If |
optlambda |
the optimal lambda. |
c |
the bent slope. |
level |
the treatment levels. |
x |
the input covariate |
a |
the input treatment |
y |
the input outcome |
method |
the method used. |
kernel |
the kernel matrix computed. |
predict |
an object of class |
refine_par |
if |
In addition, the fitted coefficients are returned depending on the object class. Specifically, theta_s_gamma
for "itrfit.svm"
object, and coef
for "itrfit.dif"
object.
Haomiao Meng
1 2 3 4 5 6 | data(sim1)
data = sim1[1:1000, ]
res = itrFit(data[, 1:2], data[, 3], data[, 4], cv = TRUE) #using bent svm loss
res = itrFit(data[, 1:2], data[, 3], data[, 4], kernel = 'polynomial', d = 4, lambda = 5^(4:11)) #using bent svm loss with polynomial kernel
res = itrFit(data[, 1:2], data[, 3], data[, 4], method = 'square', kernel = 'polynomial', d = 2, lambda = 5^(0:6)) #using bent square loss
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.