cv.psiITR: Cross validation for psiLearn learning

Description Usage Arguments Value Author(s) Examples

View source: R/cv.psi.R

Description

Return the psi-learning models with best tuning parameters.

Usage

1
cv.psiITR(X,A,R,m=5,kernel='linear',sigma=NULL,kappa.ratio=0.01,kappa.max=1.5,nkappa=10,tau=0.1,maxit=100,tol=1e-5,res=FALSE)

Arguments

X

n by p input matrix.

A

a vector of n entries coded 1 and -1 for the treatment assignments.

R

a vector of outcome variable, larger is more desirable.

m

m-folds cross validation

kernel

kernel function used in the decision function

sigma

bindwidth for 'rbf' kernel it can be provided by the user, if not, it can be estimated from Sig_est

kappa.ratio

the ratio between the max kappa and the min kappa which controls the complexity of the decision function.

kappa.max

max kappa in the tunning parameter seq

nkappa

num of kappa for grid search

tau

tuning parameter for the loss function in psi-Learn

maxit

number of max iteration used in psiITR

tol

tolerance used in psiITR

res

Whether to estimate the residual as the outcome for interaction effect, default is FALSE

Value

It returns the estimated coefficients in the decision funcion after cross validation

w

the coefficent for the decision function.

bias

the intercept in both the linear case and the kernel case.

sigma

if the kernel is rbf then the optimal sigma is returned

Author(s)

MingyangLiu <[email protected]>

Examples

1
2
3
4
5
6
7
8
          n=100;p=5
          X=replicate(p,runif(n, min = -1, max = 1))
          A=2*rbinom(n, 1, 0.5)-1
          T=cbind(rep(1,n,1),X)%*%c(1,2,1,0.5,rep(0,1,p-3))
          T0=(cbind(rep(1,n,1),X)%*%c(0.54,-1.8,-1.8,rep(0,1,p-2)))*A
          R=as.vector(rnorm(n,mean=0,sd=1)+T+T0)
          cv_psi_Linear<-cv.psiITR(X,A,R,m=5,kernel='linear',kappa.ratio=0.01,kappa.max=1.5,nkappa=10,tau=0.1,maxit=100, tol=1e-5)
          cv_psi_Rbf<-cv.psiITR(X,A,R,m=5,kernel='rbf',kappa.ratio=0.01,kappa.max=1,nkappa=10,tau=0.1,maxit=100, tol=1e-5)

mylzwq/psi-learning-for-ITR documentation built on Sept. 23, 2018, 12:56 a.m.