Computes the theoretical conditional probabilities P(X_j = 1 | C = c1)
for all variables j when attention is focused entirely on variable k*.
In this case, we have that P(X_j = 1 | C = c1) = P(X_j = 1 | X_k* = 1)
This uses the bivariate normal distribution to compute exact conditional
probabilities based on the correlation structure.
Usage
ruleStarCondProb(pxk, pxkstar, corr)
Arguments
- pxk
Numeric. Marginal probability P(X_k = 1) for variable k.
- pxkstar
Numeric. Marginal probability P(X_k* = 1) for the attention variable k*.
- corr
Numeric. Correlation between variables Xk and Xk*.
Value
Numeric value representing the conditional probability P(X_k = 1 | X_k* = 1)
Details
The function computes the joint probability P(X_k = 1, X_k* = 1) using
the bivariate normal distribution with the given correlation structure, then
divides by P(X_k* = 1) to obtain the conditional probability.
Examples
# Compute conditional probability for positively correlated variables
ruleStarCondProb(pxk = 0.3, pxkstar = 0.4, corr = 0.5)
#> [1] 0.4797267
# Compare with negatively correlated variables
ruleStarCondProb(pxk = 0.3, pxkstar = 0.4, corr = -0.5)
#> [1] 0.1337113