View source: R/bayes_functions.R
| logitHyperPars | R Documentation |
logitHyperPars is a function for calculating parameters for a logit-normal distribution, such that the distribution yields desired mean and standard deviation.
Used for sampling the c-parameter.
logitHyperPars(mean, sd)
mean |
the desired mean. |
sd |
the desired standard deviation. |
logitHyperPars returns two values. These can be directly supplied to rlogitnorm.
pars <- logitHyperPars(0.2, 0.1)
x <- logitnorm::rlogitnorm(1000000, pars[1], pars[2])
mean(x) # close to 0.2
sd(x) # close to 0.1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.