bayes.plot: Prior and Posterior Probabilities

Description Usage Arguments Value Examples

View source: R/ch3-fn.R

Description

Displaying the Prior and the Posterior Probabilities

Usage

1
bayes.plot(prior, post, group, cond, dcol, cex = 1, dig = 4)

Arguments

prior

Prior probability distribution vector.

post

Posterior probability distribution vector.

group

Class names, Default: A, B, C, ...

cond

Conditional event name, Default: F

dcol

Bar chart colors, Default: transparent rainbow colors

cex

Text size of the probability, Default: 1

dig

Number of digits below the decimal point, Default: 4

Value

None.

Examples

1
2
3
4
5
prior = c(0.2, 0.4, 0.3, 0.1)
cond = c(0.04, 0.02, 0.01, 0.05)
tot = prior*cond
post = tot / sum(tot)
bayes.plot(prior, post)

tjssu/Rstat documentation built on Aug. 8, 2020, 12:38 p.m.