Compute the shape and rate parameters from a Gamma distribution for \(\mu\) based on some prior belief about its cumulative distribution function.

getPrior_mu(x, px, y, py, s1 = 1, s2 = 0.001, plot = TRUE)

Arguments

x,px,y,py

numeric. Threshold of some prior belief about true epg. There is px probability that the true epg is below x, and there is py probability that the true epg is below y.

s1,s2

numeric. Starting values.

plot

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

Value

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

Details

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

Examples

# there is 30% probability that the mean epg is less than 200 # and 80% probability that the mean epg is less than 500 getPrior_mu(x = 200, px = 0.3, y = 500, py = 0.8)
#> [1] "muPrior = list(priorDist = 'gamma', hyperpars = c(2.359, 0.007))"