covsearch.
wpp(problem, epsilons, max_set = 12, prior_ind = 0.5, prior_table = 10, cred_calc = TRUE, M = 1000, analytical_bounds = TRUE, pop_solve = FALSE, verbose = FALSE)cfx problem instance for the ACE of a given treatment $X$ on a given outcome $Y$.TRUE, compute conditional credible intervals for the ACE of highest scoring model.cred_calc is TRUE, use the analytical method for computing bounds if this is also TRUE.TRUE, assume we know the population graph in problem instead of data. Notice that data is
still used when computing posteriors over bounds.TRUE, print out more detailed information while running the procedure.wpp containing the copies of the inputs problem, epsilons,
prior_ind, prior_table, analytical_bounds, plus the following fields:
w_listw_list$witness[i] is a witness, each
w_list$Z[[i]] is the corresponding admissible set, and each
w_list$witness_score[i] is the corresponding score for the witness/admissible set.hwhZboundsbounds_postepsilons with
witness hw and admissible set hZ.covsearch will generate a corresponding lower bound and upper
bound. The bounds reported in bounds are based on the posterior expected contingency table implied by
prior_table, which uses a numerical method to optimize the bounds. Besides these point estimates, posterior
distributions on the lower and upper bound for the highest scoring witness/admissible set can also be computed if the
flag cred_calc is set to TRUE, and reported on bounds_post. If the option analytical_bounds
is set to FALSE, the posterior distribution calculation will use the numerical method. It provides tighter
bounds, but the computational cost is much higher. Please notice these posteriors are for the bounds conditional on the
given choice of witness and admissible set: uncertainty on this choice is not taken into account.A complete explanation of the method is given by Silva and Evans (2014, "Causal inference through a witness protection program", Advances in Neural Information Processing Systems, 27, 298--306).
Note: messages about numerical problems when calling the bound optimizer are not uncommon and are accounted for within the procedure.
## Generate a synthetic problem
problem <- simulateWitnessModel(p = 4, q = 4, par_max = 3, M = 200)
## Calculate true effect for evaluation purposes
sol_pop <- covsearch(problem, pop_solve = TRUE)
effect_pop <- synthetizeCausalEffect(problem)
cat(sprintf("ACE (true) = %1.2f\n", effect_pop$effect_real))
## WPP search (with a small number of Monte Carlo samples)
epsilons <- c(0.2, 0.2, 0.2, 0.2, 0.95, 1.05)
sol_wpp <- wpp(problem, epsilons, M = 100)
summary(sol_wpp)
Run the code above in your browser using DataLab