Answers.Body: <p>This is a bit of a puzzle but you can compute a reasonable narrow limit even without knowing whether or not <span class="math-container">$P(S,A) = P(S) P(A)$</span>.</p>
  
  <p>Start with the contingency table relating <span class="math-container">$P(S, A)$</span>, <span class="math-container">$P(S,\neg A)$</span>, <span class="math-container">$P(\neg S, A)$</span>, <span class="math-container">$P(\neg S,\neg A)$</span> to <span class="math-container">$P(S)$</span> and <span class="math-container">$P(A)$</span> :</p>
  
  <p><span class="math-container">$$\begin{array}{cc|c}
  P( S,A)&amp; P(\neg S,A) &amp; P(A) \\
  P(S,\neg A)&amp; P(\neg S,\neg A) &amp; P(\neg A) \\ \hline
  P(S)&amp; P(\neg S) &amp; 1 \\
  \end{array} \quad \rightarrow \quad \begin{array}{cc|c}
  x&amp; 0.01-x &amp; 0.01 \\
  0.07-x&amp; 0.92+x &amp; 0.99 \\ \hline
  0.07&amp; 0.93 &amp; 1 \\
  \end{array}$$</span></p>
  
  <p>note that the cells must be between zero and one thus <span class="math-container">$0 \leq x \leq 0.01$</span></p>
  
  <hr>
  
  <p>Then with</p>
  
  <p><span class="math-container">\begin{array}{rcrl}P(F|S) &amp;= &amp; &amp; P(F|S,A) P(A|S) + P(F| S,\neg A) P(\neg A|S)\\
  &amp;=&amp;&amp; 1.0 \frac{x}{0.07} +  0.7 \frac{0.07-x}{0.07} \\
  &amp; = &amp;&amp; 0.7 + 4 \frac{2}{7} x  \end{array}</span></p>
  
  <p>you get</p>
  
  <p><span class="math-container">$$0.7 \leq P(F|S) \leq 0.743$$</span></p>
  
  <hr>
  
  <p>To solve <span class="math-container">$P(F|S)$</span> exactly you need to narrow down <span class="math-container">$x$</span> more precisely. Possibilities are:  </p>
  
  <ul>
  <li><p>If you know <span class="math-container">$P(F)$</span> then you could use <span class="math-container">$$\begin{array}{rcrl}P(F) &amp;= &amp; &amp; P(F|S,A) P(S,A) \\ &amp;&amp; +&amp; P(F|\neg S,A) P(\neg S,A) \\ &amp;&amp;+&amp; P(F| S,\neg A) P(S, \neg A)\\&amp;&amp;+&amp;P(F|\neg S,\neg A) P(\neg S,\neg A)\\
  &amp;=&amp;&amp; 1.0 (x) + 0.7 (0.07 - x) + 0.9 (0.01-x)+0.1(0.92+x) \\
  &amp; = &amp;&amp; 0.15-0.5 x \end{array}$$</span> </p></li>
  <li><p>If you know that <span class="math-container">$S \perp \! \! \! \perp A$</span> then you can use <span class="math-container">$x = P(S,A) = P(S)P(A) = 0.0007$</span></p></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-04T11:21:58.930Z
Answers.LastActivityDate: 2019-03-04T11:43:04.060Z
Answers.LastEditDate: 2019-03-04T11:43:04.060Z
Answers.UserDisplayName: Sextus Empiricus
Answers.Body: <p>I do not think you can compute <span class="math-container">$P(F \mid S=s)$</span> only using your given probabilities (and no further independence assumption between your random variables). </p>
  
  <p>First of all, note that <span class="math-container">$P(F \mid S=s)$</span> is the probability of <span class="math-container">$F$</span> (being equal to one of the values that <span class="math-container">$F$</span> can attain), given that the value of <span class="math-container">$S$</span> is <span class="math-container">$s$</span>. Not also that <span class="math-container">$P(F \mid S)$</span> is a shorthand for <span class="math-container">$P(F \mid S=s)$</span>.</p>
  
  <p>In general, by the <em>law of total probability</em>, we have</p>
  
  <p><span class="math-container">\begin{align}
  P(A) 
  &amp;= P(A, B) + P(A, B^c) \\
  &amp;= P(A|B)P(B) + P(A|B^c)P(B^c) \\
  &amp;= P(B|A)P(A) + P(B|A^c)P(A^c)
  \end{align}</span></p>
  
  <p>where <span class="math-container">$B^c$</span> is the complement of <span class="math-container">$B$</span> (in case <span class="math-container">$A$</span> and <span class="math-container">$B$</span> are sets or events).</p>
  
  <p>So, in your specific case, we have</p>
  
  <p><span class="math-container">\begin{align}
  P(F \mid S) 
  &amp;= P(F \mid S, A)P(A \mid S) + P(F \mid S, \lnot A)P(\lnot A \mid S) \\
  &amp;= P(F \mid S, A) \frac{P(A, S)}{P(S)} + P(F \mid S, \lnot A)\frac{P(\lnot A, S)}{P(S)} \\
  &amp;= \frac{P(F, S, A)}{P(A, S)} \frac{P(A, S)}{P(S)} + \frac{P(F,S, \lnot A)}{P(\lnot A, S)}\frac{P(\lnot A, S)}{P(S)} \\
  &amp;= \frac{P(F, S, A)}{P(S)} + \frac{P(F,S, \lnot A)}{P(S)} \\
  &amp;= \frac{1}{P(S)} (P(F, S, A) + P(F,S, \lnot A) ) \\
  &amp;= \frac{P(F, S)}{P(S)} 
  \end{align}</span></p>
  
  <p>We <span class="math-container">$P(F \mid S, A), P(S)$</span> and <span class="math-container">$P(F \mid S, \lnot A)$</span>, but we do not have <span class="math-container">$P(A, S)$</span>, <span class="math-container">$P(F, S, A)$</span> or <span class="math-container">$P(F, S)$</span> (and I think we cannot retrieve them from your given probabilities).</p>
  
  <p>(I will be happy to be corrected, if this conclusion is wrong. Maybe I'm not seeing another way of computing it now.)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-01T09:50:02.363Z
Answers.LastActivityDate: 2019-03-01T13:34:34.267Z
Answers.LastEditDate: 2019-03-01T13:34:34.267Z
Answers.UserDisplayName: nbro
Answers.Body: <p>I believe you can deduce it. Using the product rule:  </p>
  
  <p><span class="math-container">$p(x,y) = p(x\mid y)p(y)$</span>  </p>
  
  <p>we have:  </p>
  
  <p><span class="math-container">$P(F\mid S) = \frac{P(F,S)}{P(S)}$</span>  </p>
  
  <p>we have <span class="math-container">$P(S)$</span> and we do not have <span class="math-container">$P(F,S)$</span>, but we can use the addition rule:  </p>
  
  <p><span class="math-container">$p(x) = \sum_\limits y p(x, y)$</span>  </p>
  
  <p><span class="math-container">$P(F, S) = P(F,S,A) + P(F,S,\lnot A)$</span>  </p>
  
  <p>first term on the right side, using the product rule, is:  </p>
  
  <p><span class="math-container">$P(F,S,A) = P(F\mid S,A)P(S,A)$</span>  </p>
  
  <p>I assume that <span class="math-container">$S$</span> and <span class="math-container">$A$</span> are not conditionally dependent so we have:  </p>
  
  <p><span class="math-container">$P(F,S,A) = P(F\mid S, A)P(S)P(A)$</span>  </p>
  
  <p>for the second term on the right side, following the same logic, we have:  </p>
  
  <p><span class="math-container">$P(F,S,\lnot A) = P(F\mid S, \lnot A)P(S)P(\lnot A)$</span>  </p>
  
  <p>we have all the needed members so in the end we have:  </p>
  
  <p><span class="math-container">$P(F\mid S) = \frac{P(F\mid S, A)P(S)P(A) + P(F\mid S, \lnot A)P(S)P(\lnot A)}{P(S)}$</span></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-01T12:56:04.187Z
Answers.Text: You're making an assumption to calculate it. Your assumption might not be true.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-01T13:04:30.820Z
Answers.Text: True, maybe the assumption is correct, maybe it isn't, we'll see what op says. If  assumption isn't correct you can't compute it I believe.
Answers.UserDisplayName: Brale
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-01T12:49:24.773Z
Answers.LastActivityDate: 2019-03-01T12:49:24.773Z
Answers.UserDisplayName: Brale
Body: <p>I have a bayesian network, which has the following data: </p>
  
  <p><span class="math-container">$P(S) = 0.07$</span></p>
  
  <p><span class="math-container">$P(A) = 0.01$</span></p>
  
  <p><span class="math-container">$P(F \mid S,A) = 1.0$</span></p>
  
  <p><span class="math-container">$P(F \mid S, \lnot A) = 0.7$</span></p>
  
  <p><span class="math-container">$P(F \mid \lnot S, A) = 0.9$</span></p>
  
  <p><span class="math-container">$P(F \mid \lnot S, \lnot A) = 0.1$</span></p>
  
  <p>And I'm asked to get <span class="math-container">$P(F \mid S)$</span>. Is it possible? How can I deduce it? </p>
  
Tags: <bayesian-networks><probability-theory>
Title: Is it possible to compute $P( F \mid S )$ given $P(F \mid S,A)$ and $P(F \mid S, \lnot A)$ in Bayesian network?
UserDisplayName: Diego C. 
ThreadText: # Is it possible to compute $P( F \mid S )$ given $P(F \mid S,A)$ and $P(F \mid S, \lnot A)$ in Bayesian network?
  
  (Asked by: username_0 on 2019-02-28)
  
  I have a bayesian network, which has the following data:
  
  $P(S) = 0.07$
  
  $P(A) = 0.01$
  
  $P(F \mid S,A) = 1.0$
  
  $P(F \mid S, \lnot A) = 0.7$
  
  $P(F \mid \lnot S, A) = 0.9$
  
  $P(F \mid \lnot S, \lnot A) = 0.1$
  
  And I'm asked to get $P(F \mid S)$. Is it possible? How can I deduce it?
  
  **Tags:** bayesian-networks, probability-theory
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2019-03-04. Score: 1
  
  This is a bit of a puzzle but you can compute a reasonable narrow limit even without knowing whether or not $P(S,A) = P(S) P(A)$.
  
  Start with the contingency table relating $P(S, A)$, $P(S,\neg A)$, $P(\neg S, A)$, $P(\neg S,\neg A)$ to $P(S)$ and $P(A)$ :
  
  $$\begin{array}{cc|c}
  P( S,A)& P(\neg S,A) & P(A) \\
  P(S,\neg A)& P(\neg S,\neg A) & P(\neg A) \\ \hline
  P(S)& P(\neg S) & 1 \\
  \end{array} \quad \rightarrow \quad \begin{array}{cc|c}
  x& 0.01-x & 0.01 \\
  0.07-x& 0.92+x & 0.99 \\ \hline
  0.07& 0.93 & 1 \\
  \end{array}$$
  
  note that the cells must be between zero and one thus $0 \leq x \leq 0.01$
  
  ---
  
  Then with
  
  \begin{array}{rcrl}P(F|S) &= & & P(F|S,A) P(A|S) + P(F| S,\neg A) P(\neg A|S)\\
  &=&& 1.0 \frac{x}{0.07} + 0.7 \frac{0.07-x}{0.07} \\
  & = && 0.7 + 4 \frac{2}{7} x \end{array}
  
  you get
  
  $$0.7 \leq P(F|S) \leq 0.743$$
  
  ---
  
  To solve $P(F|S)$ exactly you need to narrow down $x$ more precisely. Possibilities are:
  
  * If you know $P(F)$ then you could use $$\begin{array}{rcrl}P(F) &= & & P(F|S,A) P(S,A) \\ && +& P(F|\neg S,A) P(\neg S,A) \\ &&+& P(F| S,\neg A) P(S, \neg A)\\&&+&P(F|\neg S,\neg A) P(\neg S,\neg A)\\
    &=&& 1.0 (x) + 0.7 (0.07 - x) + 0.9 (0.01-x)+0.1(0.92+x) \\
    & = && 0.15-0.5 x \end{array}$$
  * If you know that $S \perp \! \! \! \perp A$ then you can use $x = P(S,A) = P(S)P(A) = 0.0007$
  
  
  ---
  
  ### Answer by username_2 on 2019-03-01. Score: 0
  
  I do not think you can compute $P(F \mid S=s)$ only using your given probabilities (and no further independence assumption between your random variables).
  
  First of all, note that $P(F \mid S=s)$ is the probability of $F$ (being equal to one of the values that $F$ can attain), given that the value of $S$ is $s$. Not also that $P(F \mid S)$ is a shorthand for $P(F \mid S=s)$.
  
  In general, by the *law of total probability*, we have
  
  \begin{align}
  P(A)
  &= P(A, B) + P(A, B^c) \\
  &= P(A|B)P(B) + P(A|B^c)P(B^c) \\
  &= P(B|A)P(A) + P(B|A^c)P(A^c)
  \end{align}
  
  where $B^c$ is the complement of $B$ (in case $A$ and $B$ are sets or events).
  
  So, in your specific case, we have
  
  \begin{align}
  P(F \mid S)
  &= P(F \mid S, A)P(A \mid S) + P(F \mid S, \lnot A)P(\lnot A \mid S) \\
  &= P(F \mid S, A) \frac{P(A, S)}{P(S)} + P(F \mid S, \lnot A)\frac{P(\lnot A, S)}{P(S)} \\
  &= \frac{P(F, S, A)}{P(A, S)} \frac{P(A, S)}{P(S)} + \frac{P(F,S, \lnot A)}{P(\lnot A, S)}\frac{P(\lnot A, S)}{P(S)} \\
  &= \frac{P(F, S, A)}{P(S)} + \frac{P(F,S, \lnot A)}{P(S)} \\
  &= \frac{1}{P(S)} (P(F, S, A) + P(F,S, \lnot A) ) \\
  &= \frac{P(F, S)}{P(S)}
  \end{align}
  
  We $P(F \mid S, A), P(S)$ and $P(F \mid S, \lnot A)$, but we do not have $P(A, S)$, $P(F, S, A)$ or $P(F, S)$ (and I think we cannot retrieve them from your given probabilities).
  
  (I will be happy to be corrected, if this conclusion is wrong. Maybe I'm not seeing another way of computing it now.)
  
  
  ---
  
  ### Answer by username_3 on 2019-03-01. Score: 0
  
  I believe you can deduce it. Using the product rule:
  
  $p(x,y) = p(x\mid y)p(y)$
  
  we have:
  
  $P(F\mid S) = \frac{P(F,S)}{P(S)}$
  
  we have $P(S)$ and we do not have $P(F,S)$, but we can use the addition rule:
  
  $p(x) = \sum\_\limits y p(x, y)$
  
  $P(F, S) = P(F,S,A) + P(F,S,\lnot A)$
  
  first term on the right side, using the product rule, is:
  
  $P(F,S,A) = P(F\mid S,A)P(S,A)$
  
  I assume that $S$ and $A$ are not conditionally dependent so we have:
  
  $P(F,S,A) = P(F\mid S, A)P(S)P(A)$
  
  for the second term on the right side, following the same logic, we have:
  
  $P(F,S,\lnot A) = P(F\mid S, \lnot A)P(S)P(\lnot A)$
  
  we have all the needed members so in the end we have:
  
  $P(F\mid S) = \frac{P(F\mid S, A)P(S)P(A) + P(F\mid S, \lnot A)P(S)P(\lnot A)}{P(S)}$
  
  > **Comments:**
  > **username_2**: You're making an assumption to calculate it. Your assumption might not be true.  
  > **username_3**: True, maybe the assumption is correct, maybe it isn't, we'll see what op says. If  assumption isn't correct you can't compute it I believe.  
  
  ---
  
  