scaleLogToOrig {lognorm} | R Documentation |
Scale standard deviation between log and original scale.
Description
When comparing values at log scale that have different sd at original scale, better compare log(mean) instead of mu.
Usage
scaleLogToOrig(logmean, sigma)
scaleOrigToLog(mean, sd)
Arguments
logmean |
log of the expected value |
sigma |
standard deviation at log scale |
mean |
expected value at original scale |
sd |
standard deviation at original scale |
Value
numeric matrix with columns mean
, and sd
at original scale
Functions
-
scaleLogToOrig
: get logmean and sigma at log scale -
scaleOrigToLog
: get mean and sd at original scale
Examples
xLog <- data.frame(logmean = c(0.8, 0.8), sigma = c(0.2, 0.3))
xOrig <- as.data.frame(scaleLogToOrig(xLog$logmean, xLog$sigma))
xLog2 <- as.data.frame(scaleOrigToLog(xOrig$mean, xOrig$sd))
all.equal(xLog, xLog2)
xLog3 <- as.data.frame(getParmsLognormForMoments(xOrig$mean, xOrig$sd^2))
all.equal(xLog$sigma, xLog3$sigma) # but mu < logmean
[Package lognorm version 0.1.10 Index]