Description Usage Arguments Value Examples
Compute posterior approximation given observed treatment assignments and a fixed covariance matrix
1 2 | gpbal_fixed(y, cov_matrix, tol = 0.01, max_iters = 20, verbose = T,
approx_method = "ep", ep_vers = "parallel")
|
y |
Set of observed treatment assignments (y in (0,1)) |
cov_matrix |
Covariance matrix; for examples, see |
tol |
Tolerance of algorithms. Difference between the latent scores at each iteration - default 1e-2 |
max_iters |
Maximum number of iterations of the algorithm - default 20 |
verbose |
Decision to print progress to screen - default TRUE |
approx_method |
Approximation method for posterior: 'ep' or 'laplace' |
ep_vers |
'Sequential' or 'Parallel' EP Algorithm - default |
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
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.