Description Usage Arguments Value Examples
Compute optimally balanced Gaussian process propensity scores
1 2 3 |
X |
Matrix of covariates to be included in the analysis and balanced on |
y |
Set of observed treatment assignments (y in (0,1)) |
cov_function |
Covariance matrix; for examples, see |
verbose |
Decision to print progress to screen - default TRUE |
ep_vers |
Sequential or Parallel EP Algorthim - default |
tol |
Tolerance of algorithms. Difference between the latent scores at each iteration - default 1e-2 |
max_iters |
Maximum number of iterations of algorithm - default 20 |
Object that contains the weights obtained from the balancing procedure and parameters from the optimization procedure
The object that is returned is a list that contains the following entries
Number_Iters
- Number of iterations for algorithm
PosteriorMean
- Posterior mean of latent scores
PosteriorVar
- Posterior covariance of latent scores
tilde_nu
-
tilde_tau
-
log_Z_ep
- EP Approximation to Log Likelihood
ComputationTime
- Runtime of EP algorithm for fixed covariance matrix
thetas
- optimal theta from optimization routine
ps
- Probit transformed posterior mean
1 2 3 4 5 6 7 8 9 | n_obs <- 500
X1 <- rnorm(n_obs)
X2 <- rnorm(n_obs)
p <- pnorm( 0.5 * X1 + 0.5 * X2 )
TA <- rbinom(n_obs, 1, p)
dat <- data.frame(X1 = X1, X2 = X2, TA = TA)
covmat <- sqexp(cbind(X1, X2))
system.time(res <- gpbal_fixed(TA, covmat))
plot(res$ps, p, pch = 19, col = rgb(0,0,0,0.5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.