sample_distribution | R Documentation |
Sample a distribution of observable probabilities that satisfy the causal model
sample_distribution(
obj,
simplex_sampler = function(k) {
rdirichlet(k, alpha = 1)
}
)
obj |
An object of class "causalmodel" |
simplex_sampler |
A function to generate a random sample from the simplex in k dimensions, where k is the number of variables (q parameters, obj$data$variables). By default this is uniform (symmetric dirichlet with parameter 1). |
A vector of observable probabilities that satisfy the causal model
graph <- initialize_graph(graph_from_literal(Z -+ X, X -+ Y, Ur -+ X, Ur -+ Y))
prob.form <- list(out = c("X", "Y"), cond = "Z")
iv_model <- create_causalmodel(graph, prob.form = prob.form)
sample_distribution(iv_model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.