# NOT RUN {
# sample in normal space
mu <- 5
sigma <- 2
rrNorm <- rnorm(1000, mean = mu, sd = sigma)
# transform to orignal scale
rrOrig <- exp(rrNorm)
# and re-estimate parameters from original scale
res <- getParmsLognormForMedianAndUpper(
median(rrOrig), quantile(rrOrig, probs = 0.95), sigmaFac = qnorm(0.95))
expected <- c(mu = mu,sigma = sigma)
all.equal(res[1,], expected, tolerance = .1, scale = 1)
# }
Run the code above in your browser using DataLab