credibleIntervals: Summarise the posterior samples from a binomial mixture model...

View source: R/credibleIntervals.R

credibleIntervalsR Documentation

Summarise the posterior samples from a binomial mixture model (BMM) undertaken using the function friedsIndexBMM.

Description

credibleIntervals provides credible intervals and posterior density plots for: (i) the hatch probabilities (hatch rates) under sterile male mating; (ii) the hatch probabilities (hatch rates) under wildtype male mating; (iii) the proportion of matings that were between wildtye females and sterilised males; and (iv) Fried's index.

Usage

credibleIntervals(samples, wildToSterileRatio = 1, col = "blue",
  quantiles = c(0.025, 0.25, 0.5, 0.75, 0.975))

Arguments

samples

is a list obtained as the output from running the function friedsIndexBMM.

wildToSterileRatio

is a numeric value that gives the ratio of wildtype to sterile males used in the cage experiments. It is assumed that all cages used the same ratio. The default value is 1.0, which corresponds to equal numbers of wildtype to sterile males.

quantiles

are the quantiles that the sure would like summarised to the terminal window from the posterior samples. By default this is quantiles = c(0.025, 0.25, 0.5, 0.75, 0.975) which can be used to obtain the median and credible intervals.

Details

The function generates a plot and prints posterior summary information in the form of credible intervals to the terminal window.

Value

The function returns NULL.

Examples

data(dataset_multiRep)
samples <- friedsIndexBMM(dataset_multiRep)
credibleIntervals(samples, wildToSterileRatio = 1) 

data(dataset_singleRep)
samples <- friedsIndexBMM(dataset_singleRep)
credibleIntervals(samples, wildToSterileRatio = 1) 

dpagendam/friedsIndex documentation built on July 17, 2022, 5:41 a.m.