Description Usage Arguments Value Author(s) See Also Examples
Given the tunning parameters return the psiLearning model to estimate the optimal ITR
1 |
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. |
w0 |
Inital estimate for the coefficients from |
tau |
tuning parameter for the loss function in psi-Learn |
kappa |
tunning parameter to control the complexity of the decision function. |
maxit |
maximum iterations |
tol |
tolerance error bound |
kernel |
kernel function for psi-Learning, can be |
sigma |
when using the rbf kernel, the bandwidth parameter for 'rbf' kernel, default is 0.5. |
res |
Whether to estimate the residual as the outcome for interaction effect, default is FALSE |
It returns the estimated coefficients in the decision funcion and the fitted value
w |
the coefficent for the decision function, if in the linear case it is p-dimension and if in the rbf kernel case, it is n-dimension. |
bias |
the intercept in both the linear case and the kernel case. |
fit |
a vector of estimated values for \hat{f(x)} in training data, in the linear case it is fit=bias+X*w and in the kernel case fit=bias+K(X,X)w. |
MingyangLiu <liux3941@umn.edu>
1 2 3 4 5 6 7 8 9 10 11 | 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)
w0.Linear=psi_Init(X,A,R,kernel='linear')
psi_Linear<-psiITR(X,A,R,w0.Linear,tau=0.1,kappa=0.5,maxit=100,tol=1e-4,kernel='linear')
w0.rbf=psi_Init(X,A,R,kernel='rbf')
sigma=Sig_est(X,A)
psi_rbf<-psiITR(X,A,R,w0.rbf,tau=0.1,kappa=0.1,maxit=100,tol=1e-4,kernel='rbf',sigma=sigma)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.