predict.qlearn: Predict optimal treatment by Qlearning

Description Usage Arguments Value Author(s) See Also Examples

View source: R/predict.R

Description

This function predicts optimal treatments for a given Q-learning model of class 'qlearn'.

Usage

1
2
## S3 method for class 'qlearn'
predict(object, x,...)

Arguments

object

a model with class 'qlearn'

x

a matrix of feature variables,has p columns that is p dimensions of feature variables

...

further arguments passed to or from other methods.

Value

a vector of optimal treatments, each entry is for a row in x, the matrix of new feature variables.

Author(s)

Ying Liu

See Also

Qlearning_Single

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
n=200
A=2*rbinom(n,1,0.5)-1
p=10
mu=numeric(p)
Sigma=diag(p)
X=mvrnorm(n,mu,Sigma)
R=X[,1:3]%*%c(1,1,-2)+X[,3:5]%*%c(1,1,-2)*A+rnorm(n)

model1=Qlearning_Single(X,A,R)
m=100
Xtest=mvrnorm(m,mu,Sigma)
predict(model1,Xtest)

DTRlearn documentation built on April 6, 2018, 1:04 a.m.