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