Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1026376 // bayes2

JavaX fragment (include)

// likelihood = P(E | H)
// prior = P(H)
// antiLikelihood (name?) = P(E | not H)
// returns P(H | E)
static double bayes2(double likelihood, double prior, double antiLikelihood) {
  ret prior*likelihood/(prior*likelihood+(1-prior)*antiLikelihood);
}

Author comment

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: 181 / 213
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)