scaleLogToOrig: Scale standard deviation between log and original scale.

Description Usage Arguments Value Functions Examples

View source: R/lognorm.R

Description

When comparing values at log scale that have different sd at original scale, better compare log(mean) instead of mu.

Usage

1
2
3

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

Examples

1
2
3
4
5
6
  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 

bgctw/lognorm documentation built on March 17, 2021, 3:21 a.m.