Density distributions of lognormal distributions (lines) get closer to normal density shaded area) as multiplicative standard deviation σ* decreases down to 1.2 for same μ* = 1.
## Warning: A numeric `legend.position` argument in `theme()` was deprecated in ggplot2
## 3.5.0.
## ℹ Please use the `legend.position.inside` argument of `theme()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
Are already provided with the base stats package. See
?dlnorm
.
## [1] 1.419068
## [1] 1.822119
## mean var cv
## [1,] 2.064731 1.210833 0.5329404
Mode < Median < Mean for the right-skewed distribution.
The return type of getLognormMoments
is a matrix.
moments <- cbind(mean = c(1,1), var = c(0.2, 0.3)^2 )
(theta <- getParmsLognormForMoments( moments[,1], moments[,2]))
## mu sigma
## [1,] -0.01961036 0.1980422
## [2,] -0.04308885 0.2935604
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
The larger the spread, the more skewed is the distribution, here both with an expected value of one.