Learn R Programming

causaloptim (version 1.0.0)

check_constraints_violated: Check whether any of the observable constraints implied by the causal model are violated for a given distribution of observables

Description

Check whether any of the observable constraints implied by the causal model are violated for a given distribution of observables

Usage

check_constraints_violated(obj, probs, tol = 1e-12)

Value

Either TRUE (violated) or FALSE (not violated) with messages indicating what constraints are violated if any.

Arguments

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

Examples

Run this code
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))

Run the code above in your browser using DataLab