How to implement conditional probability distribution on set-valued Random variables I'm trying to implement conditional probability distribution when the events of two RVs are sets. If I try to extrapolate concepts from real or categorical variables to sets things become confusing for me. In particular, for some pair of discrete RVs, $X,Y$ we can compute the conditional probability of two events by using the Bayes theorem:
$$P(Y=y|X=x)=\frac{P(X=x|Y=y)P(Y=y)}{\sum_{y'\in\mathcal{Y}}P(X=x|Y=y')P(Y=y')}=\frac{f(x,y)}{\sum_{y'\in\mathcal{Y}}f(x,y')},$$
where $f(x,y)=\sum_{(x',y')\in (\mathcal{X},\mathcal{Y})}\chi(x'=x,y'=y)$ is an accumulator function giving the total number of times the specific joint event $x,y$ is observed in the sample space (i.e. the indicator function $\chi(x'=x,y'=y)$ equals one when $x'=x,y'=y$ holds). I'd like to compute such probability when events drawn by $X,Y$ are sets $X_i,Y_j$, respectively. So, how to define the corresponding $f(X_i,Y_j)$?
I've tried with:
$$f(X_i,Y_i)=\sum_{j}|(X_i\cap Y_i)\cap(X_j\cap Y_j)|.$$
The motivation behind is that $X_i\cap Y_i$ provides a measure of how the attributes of both sets should be observed jointly (such as any intersection event). In turn intersecting this intersection event against other intersection events $X_j\cap Y_j$ should provide the measure of how much the joint attributes are observed through the sample space. However, I'm not sure whether this analogy is correct with respect to the usual notion of observing joint events in a sample space. Please, some one can help me to clarify/fix/prove this?
Thank you in advance
Keeping it to discrete space, the joint probability of an event can be interpreted as the fraction of the size of this subset compared to the whole state space.
In case of events, being sets themselves, the definition remains the same.
$$P(X_i,Y_j) = \frac{|\{(x,y) \in  (X_i,Y_j)|\}} {|\Omega|} $$
$|\Omega|$ is just the set of all combinations of single events (x,y).
Let us now check your formula with the following example:
$$X_0 = Y_1 = \{0\}, ~~ X_1 = Y_0 = \{1\}$$
Then the total space space $X \times Y$,
$$ \Omega  = \{(0,0),(0,1),(1,0),(1,1)\} $$
And for example:
$$ P(X_0,Y_0) = P( (0,0) ) = \frac{1}{4} $$
Your formula however implies,
$$ | (X_i \cap Y_i) \cap  (X_j \cap Y_j) | = 0 $$
as $X_i \cap Y_i$ is empty per contruction in the example.