# how to calculate the evidence in a hybrid bayesian network

The wikipedia page on bayesian networks gives a clear example on bayesian network on discrete variables, its says that

My question is how this will differ if S is continuous? Or more generally how one calculates the marginal probability of a hybrid bayesian network?

In probability theory, marginalizing any discrete random variable $X$ requires one to sum over the probability mass function of the joint probabilities over all values of $X$. When $X$ is continuous, the distribution for $X$ will also be continuous, so to marginalize a continuous variable we can integrate the pdf with respect to $X$ over all values $(-\inf, \inf)$.

$$P(R=T \mid G = T) = \dfrac{\int P(G = T, s, R = T) ds}{\sum_{R \in {\{T, F}\}} \int P(G = T, s, R)ds}$$

• Thanks for your answer vey much but can you please elaborate more with a numeric example? Commented Sep 14, 2015 at 9:13
• please correct me if i am wrong, doesn't this mean that the integral part will sum to 1 since we are integrating over all values? Commented Sep 16, 2015 at 0:43
• We are only integrating with respect to the variable we are trying to marginalize. In this case, we are trying to marginalize with respect to s so we are integrating with respect to s. We will still have a probability function over G and R. Commented Sep 16, 2015 at 4:37
• sorry for any inconvenience I have caused but please take a look at this question here stats.stackexchange.com/questions/173119/… it has a more detailed example on that case, if you kindly answer it I would really appreciate it as you seem to be the only who actually offered his help...thanks again Commented Sep 19, 2015 at 0:15
• I have accepted your answer...and as for the other question you can also answer it even if someone already answered it for example the current answer only explains it in concept you can answer it in numbers using the sufficient stats I have provided Commented Sep 19, 2015 at 11:49