simulate_bounds | R Documentation |
Run a simple simulation based on the bounds. For each simulation, sample the set of counterfactual probabilities from a uniform distribution, translate into a multinomial distribution, and then compute the objective and the bounds in terms of the observable variables.
simulate_bounds(obj, bounds, nsim = 1000)
obj |
Object as returned by analyze_graph |
bounds |
Object as returned by optimize_effect_2 |
nsim |
Number of simulation replicates |
A data frame with columns: objective, bound.lower, bound.upper
b <- initialize_graph(graph_from_literal(X -+ Y, Ur -+ X, Ur -+ Y))
obj <- analyze_graph(b, constraints = NULL, effectt = "p{Y(X = 1) = 1} - p{Y(X = 0) = 1}")
bounds <- optimize_effect_2(obj)
simulate_bounds(obj, bounds, nsim = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.