Learn R Programming

dupiR (version 1.2)

plotPosterior: Plot posterior probability distributions

Description

Produces publication-level plots of posterior probability distributions computed using computePosterior. A data summary, credible intervals at a given confidence level, maximum a posteriori (and more) are indicated.

Usage

plotPosterior(object, low = 0.025, up = 0.975, xlab, step, ...)

Arguments

object
An object of class 'Counts'
low
The left tail posterior probability. Default to 0.025.
up
1 - the right tail posterior probability. Default to 0.975.
xlab
The x-axis label. If not provided, default to 'n'.
step
An integer defining the increment for x-axis labels (i.e. the separation between two consecutive tick marks).
...
Additional arguments to be passed to the plot function

Value

Methods

an object of class Counts.

See Also

Counts-class, computePosterior

Examples

Run this code
K <- newCounts( counts = c(20,30), fractions = c(0.075, 0.10))

#using default parameters (DUP, sampling without replacement and default prior support)
K.dup <- computePosterior(K)

plotPosterior(K.dup, type = 'l', lwd = 3, col = 'blue3', low = 0.025, up = 0.975)

Run the code above in your browser using DataLab