# Example 6b: Bayesian Network 'Student Model' with more evidence

## DAG of Bayesian Network 'Student Model'

Andrew D. Gordon, Thomas A. Henzinger, Aditya V. Nori, and Sriram K. Rajamani. 2014. Probabilistic programming. In Proceedings of the on Future of Software Engineering (FOSE 2014). ACM, New York, NY, USA, 167-181. DOI=10.1145/2593882.2593900 http://doi.acm.org/10.1145/2593882.2593900

## Ex6b: CHURCH-Code for Bayesian Network 'Student Model' and Inference P(G | L=1)

The PROB-code snippet from Gordon et al. is translated by us to a functional CHURCH program to clarify its semantics. The generative model is contained in the CHURCH function "take-a-sample". The direction of inference in the conditional P(G | L=1) = P(Grade | weak_letter) is inverse to the direction of CPDs in the generative Bayesian network.

Here is a summary of the domains due to the modifications of Gordon et al. (2014):

Val(D) = <d0, d1> = <easy, hard>

Val(I) = <i0, i1> = <non smart, smart>

Val(G) = <g0, g1> = <A, B+C> = <excellent, good+average>

Val(S) = <s0, s1> = <low score, high score>

Val(L) = <l0, l1> = <strong_letter, weak_letter>

The number of samples was set to 20000 in this run. This number could in principle be increased to get a better precision of estimates. The value of the variable math_expect (= parameter theta in the HOEFFDING inequality) was computed by the exact 'variable-elimination' inference method in the probabilistic programming language FIGARO. The sampling method used in our CHURCH-program is the simple-to-understand 'forward sampling'. The screen-shot presented was generated by using the PlaySpace environment of WebCHURCH.

The inferred E(G | L=1) = P(G=1 | L=1) is near 0.91 and much higher than in the reverse direction, so the verbal interpretation is "If you have a weak recommendation letter, then a nonexcellent grade is pretty certain".

Webmaster (maaanuela.wuestefeld@e3uol.su7desdn) (Changed: 2020-01-23)