1 | // likelihood = P(E | H) |
2 | // prior = P(H) |
3 | // antiLikelihood (name?) = P(E | not H) |
4 | // returns P(H | E) |
5 | static double bayes2(double likelihood, double prior, double antiLikelihood) { |
6 | ret prior*likelihood/(prior*likelihood+(1-prior)*antiLikelihood); |
7 | } |
Began life as a copy of #1026375
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1026376 |
Snippet name: | bayes2 |
Eternal ID of this version: | #1026376/1 |
Text MD5: | c508f4ce41f1d8323972ae36ea0c113c |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-12-29 22:05:42 |
Source code size: | 256 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 180 / 212 |
Referenced in: | [show references] |