probability {cfid} | R Documentation |
Symbolic Probability Distributions
Description
Defines an interventional or observational (conditional) probability
P(y|do(x),z)
. For formatting options, see format.probability()
.
Usage
probability(val = NULL, var = NULL, do = NULL, cond = NULL)
## S3 method for class 'probability'
format(x, use_do = FALSE, ...)
## S3 method for class 'probability'
print(x, ...)
Arguments
val |
An |
var |
A |
do |
A |
cond |
A |
x |
A |
use_do |
A |
... |
Additional arguments passed to |
Value
An object of class probability
, which is a list
containing
all of the arguments of the constructor.
A character
representation of the probability
object
in LaTeX syntax.
See Also
counterfactual_variable()
, functional()
Examples
# Example from Makhlouf, Zhioua and Palamidessi (2021)
g2 <- dag("C -> A -> Y; C -> Y")
v1 <- cf("Y", 0, c(A = 1))
v2 <- cf("A", 0)
c1 <- conj(v1)
c2 <- conj(v2)
f <- identifiable(g2, c1, c2)$formula
# Default, using primes and subscript notation
format(f)
# Without primes, no do-operator
format(f, use_primes = FALSE)
# Primes, with do-operator
format(f, use_do = TRUE)
# Without primes, with do-operator
format(f, use_primes = FALSE, use_do = TRUE)