Learn R Programming

eggCounts (version 2.4)

getPrior_delta: Get prior parameters from Beta distribution

Description

Compute the shape parameters from a Beta distribution for \(\delta\) based on some prior belief.

Usage

getPrior_delta(lower, upper, p = 0.7, mode, conc, plot = TRUE)

Value

Returns Beta prior parameters for \(\delta\) and the printed argument to use in a fecr_stan() or a fec_stan() function call.

Arguments

lower,upper,p

numeric. Prior belief about the reduction. There is p probability that the reduction is between lower and upper. Not used if mode and conc are supplied.

mode,conc

numeric. Prior belief about the reduction. The mode and concentration parameters of a beta distribution. Higher concentration indicates smaller variance. Not used if lower and upper thresholds are supplied.

plot

logical. If TRUE, the prior distribution is plotted after parameters are found.

Author

Tea Isler
Craig Wang

Details

The multiroot function from rootSolve package is used to compute the parameters.

Examples

Run this code
# there is 80% probability that the reduction is between 60% and 90%
getPrior_delta(lower = 0.6, upper = 0.9, p = 0.8)

Run the code above in your browser using DataLab