Skip to content

Instantly share code, notes, and snippets.

@zobar
Created May 10, 2019 19:12
Show Gist options
  • Save zobar/19cfa00e2545d945bf81149bca79f595 to your computer and use it in GitHub Desktop.
Save zobar/19cfa00e2545d945bf81149bca79f595 to your computer and use it in GitHub Desktop.
X Y Z
ab 33 333 3333
ac 33 333 3333
bc 33 333 3333
qu 1 1 1
P(X) P(q|X) P(u|X)
P(X|qu) = ------------------------------------------------------------
P(X) P(X|q) P(X|u) + P(Y) P(Y|q) P(Y|u) + P(Z) P(Z|q) P(Z|u)
100 1000 10000
P(X) = ----- P(Y) = ----- P(Z) = -----
11100 11100 11100
1 1
P(q|X) = ----- P(u|X) = -----
11100 11100
1 1
P(X|q) = - P(X|u) = -
3 3
1 1
P(Y|q) = - P(Y|u) = -
3 3
1 1
P(Z|q) = - P(Z|u) = -
3 3
100 1000 10000
----- ----- -----
11100 11100 11100
P(X|qu) = ---------------------------------
100 1 1 1000 1 1 10000 1 1
----- - - + ----- - - + ----- - -
11100 3 3 11100 3 3 11100 3 3
1000000000
-------------
1367631000000
P(X|qu) = ---------------------
100 1000 10000
----- + ----- + -----
99900 99900 99900
1000
-------
1367631
P(X|qu) = -------
11100
-----
99900
99900000
P(X|qu) = ----------- = 0.00658
15180704100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment