| bayes_total | R Documentation |
Given a set of events it computes the total or conditional probability after Bayes. The events should be R names and the available operators are
bayes_total(target, partition = NULL, ...)
target |
character: target event |
partition |
character: set of events which form a partition |
... |
numeric: named events with given probabilities |
! complementary event,
| conditional event, and
^ intersection of events.
The attribute compute of the return value contains the steps for computation.
resulting probability including the steps for computing. If NA is returned then no solution could be found.
bayes_total('M|T', c("M", "!M"), "M"=0.6, "T|M"=0.75, "T|!M"=0.39, 0.4)
pmt <- bayes_total("M|T", c("M", "!M"), "M"=0.6, "T|M"=0.75, "T|!M"=0.39, 0.4)
cat(paste0(attr(pmt, "compute"), "\n"))
#
bayes_total('A|K', c("A", "B", "C"), "A"=0.55, "B"=0.35, "C"=0.1, "K|A"=0.4, "K|B"=0.1, "K|C"=0.1)
bayes_total('K', c("A", "B", "C"), "A"=0.55, "B"=0.35, "C"=0.1, "K|A"=0.4, "K|B"=0.1, "K|C"=0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.