Skip to contents

Returns the summary (min, max, IQR, median, mean) of the PMF specified by pmf.

Usage

PMF.summary(pmf, Ltoll = .TOLL, Rtoll = .RTOLL)

Arguments

pmf

the PMF object.

Ltoll

used for computing the min of the PMF: the min is the smallest value with probability greater than Ltoll (default: 1e-15)

Rtoll

used for computing the max of the PMF: the max is the largest value with probability greater than Rtoll (default: 1e-9)

Value

A summary data.frame

Examples

library(bayesRecon)

# Let's build the pmf of a Binomial distribution with parameters n and p
n <- 10
p <- 0.6 
pmf_binomial <- apply(matrix(seq(0,10)),MARGIN=1,FUN=function(x) dbinom(x,size=n,prob=p))

# Print the summary of this distribution
PMF.summary(pmf=pmf_binomial)
#>   Min. 1st Qu. Median Mean 3rd Qu. Max
#> 1    0       5      6    6       7  10