check_constraints_violated | R Documentation |
Check whether any of the observable constraints implied by the causal model are violated for a given distribution of observables
check_constraints_violated(obj, probs, tol = 1e-12)
obj |
An object of class "causalmodel" |
probs |
A named vector of observable probabilities, in the same order as obj$data$parameters |
tol |
Tolerance for checking (in)equalities |
Either TRUE (violated) or FALSE (not violated) with messages indicating what constraints are violated if any.
graph <- initialize_graph(graph_from_literal(Z -+ X, X -+ Y, Ur -+ X, Ur -+ Y))
iv_model <- create_causalmodel(graph, prob.form = list(out = c("X", "Y"), cond = "Z"))
check_constraints_violated(iv_model, probs = sample_distribution(iv_model))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.