logitHyperPars: Convert mean and standard deviation into logit-normal...

View source: R/bayes_functions.R

logitHyperParsR Documentation

Convert mean and standard deviation into logit-normal distribution parameters

Description

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.

Usage

logitHyperPars(mean, sd)

Arguments

mean

the desired mean.

sd

the desired standard deviation.

Value

logitHyperPars returns two values. These can be directly supplied to rlogitnorm.

Examples

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


TestDesign documentation built on Feb. 16, 2023, 7:19 p.m.