Tutorial 7 Forward sampling, AgenaRisk and Quickscore Tal Shor Forward sampling Using AgenaRisk, Fitting data to a network, and proof Forward sampling reminder Un-Weighted version counter = 0 for i=[1,M]: s = sample from P(S) r = sample from P(R) h = sample from P(H|S=s,R=r) e = sample from P(E|S=s) g = sample from P(G|H=h,E=e) If (condition holds - g=1) counter++ R Weighted version counter = 0 for i=[1,M]: w=1 S = sample from P(S) R = sample from P(R) H = sample from P(H|S,R) E = set to true. w *= P(E=1|S=s) G = sample from P(G|H,E) If (condition holds - g=1) counter += w Output = counter / M S H E G Forward sampling proof (for the specific BN) β’ Let π€ be the weight function, so π€ π = π πΈ = 1 π = π β’ So the mean of π€ is E w(s) = P(E=1|S=0)P(S=0)+P(E=1|S=1)P(S=1)=P(E=1) β’ Our counter would be the function times the condition passed ππ€ π such that π is the number of π πΈ πππ’ππ‘ππ = πΈ[πΈ[ π€π π = π ] = πΈ[π β π(πΈ = 1)] = π β π πΊ = 1 πΈ = 1 β π πΈ = 1 = π β π(πΊ = 1, πΈ = 1) Quickscore A rundown of the paper : A Tractable Inference Algorithm for Diagnosing Multiple Diseases Definitions β’ We will be looking at bi-partite graphs that represents diseases and symptoms. β’ π would symbolize a disease node, where π+ denotes the present of that particular disease, and πβ denotes itβs absence. β’ π refers to symptoms, π + , π β denotes present and absence of that symptom. β’ π·π would be some instance of all diseases, such that π·π+ are all the present diseases, and π·πβ are all those who are absence. Assumptions 1. Diseases are marginally independent, and symptoms are conditionally independent. 2. If a disease is absence, it cannot cause any symptom. 3. Knowing whether or not ππ causes π to be present, does not effect the probability that π2 causes π. Assumptions (2) β’ Those assumptions hold under a new model, where for each ππ , ππ , π we have the subgraph that includes causality nodes for each disease followed by an OR gate. β’ The lack of edge between the oval nodes is the embodiment of our 3rd assumption and this condition independence is called casual independence Probability of a symptom β’ Under this model, weβll denote π π + ππππ¦ ππ πππ ππ‘ππ£π = ππ β π π β ππππ¦ ππ πππ ππ‘ππ£π = 1 β ππ β’ Due to the or gate we can see that π π β π·π = π(π β |ππππ¦ ππ ) πβπ·π+ Therefore 3 π πβ = π π β π·π π π·π = π(π β |ππππ¦ ππ ) π π·π π·π βπ· πβπ·π+ π·π βπ· π π β ππππ¦ ππ = π·π βπ· πβπ·π+ π π+ πβD+ π π πβ πβDβ π 3 β (5) proof π π π β ππππ¦ ππ π ππ+ + π ππβ π=1 π π β ππππ¦ ππ π ππ+ = ππβ π πβπ πβπ π π β ππππ¦ π = π·π βπ· πβπ·π+ π ππβ π π = p πβ π π πβπ·π+ πβπ·πβ Implications of 3 β (5) β’ Now, we donβtβ have to search every possible disease instance (2π ), we can compute π(π ) in π(π). β’ Since our symptoms are conditionally independent, we get that π 6 π πΉβ = π π β ππππ¦ ππ π=1 π ππ+ + π ππβ πβπΉ β β’ Under some other, unspecified calculations, we can derive that π 10 π πΉ + = β1 πΉ β² β2πΉ + πΉβ² π π β ππππ¦ ππ π=1 πβπΉ β² π ππ+ + π ππβ Quickscore final formula β’ The stark difference in complexity between positive symptoms and + negative ones, is quite obvious due to πΉ β² β 2πΉ . 11 π πΉ β , πΉ + = β1 πΉ β² β2πΉ + π πΉβ² π π β ππππ¦ ππ π=1 π ππ+ + π ππβ πβπΉ β² βͺπΉ β β , πΉ + |π π(π ) π πΉ π π + β 12 π ππ πΉ , πΉ = π πΉβ, πΉ+ Where π πΉ β , πΉ + |ππ can be calculated by setting π ππ+ = 1 in (11) Example (copy to whiteboard) Figure 4.37 in the textbook at chapter 4.5.3 .01 .1 π·1 π·2 .1 .8 .2 .2 π·3 .9 .1 .5 .2 π·4 .7 .8 .2 π1 π2 π3 π4 + - + - Quicksort calculation π β1 πΉ β² β2πΉ + πΉβ² π π β ππππ¦ ππ π=1 π ππ+ + π ππβ πβπΉ β² βͺπΉ β β’ πΉβ² = β 0.9 β 1 β 0.01 + 0.99 β = 0.763 0.7 β 1 β 0.1 + 0.9 β 1 β 0.8 β 0.2 + 0.8 β 0.5 β 0.2 β 0.2 + 0.8 β’ πΉ β² = π1 0.8 β 0.9 β 1 β 0.01 + 0.99 β 0.1 β 1 β 0.7 β 0.1 + 0.9 β β 1 β 0.5 β 0.2 β 0.2 + 0.8 = 0.712 1 β 1 β 0.8 β 0.2 + 0.8 β’ πΉ β² = π3 : 0,644, πΉ β² = π1 , π3 : 0.602 β π πΉ + , πΉ β = 0.763 β 0.712 β 0.644 + 0.602 = 0.009 Quicksort calculation (2) β’ Letβs say we are interested in π1 . Weβll set the probability as (12) requires, and β’ πΉβ² = β β’ 0.9 β 1 β 1 + 0 β 0.7 β 1 β 0.1 + 0.9 β 1 β 0.8 β 0.2 + 0.8 β 0.5 β 0.2
© Copyright 2026 Paperzz