library(dplyr)
library(knitr)

Finding parameters

The lognormal distribution is expressed via its mu and sigma parameters. However, most interpretations of sample data examines the mean and standard deviation. It is straightforward to translate from one to the other.

lstParams <- LognormalParams(10e3, 1.5)
lstParams$mu
lstParams$sigma

Examining the likelihood

sample_data <- rlnorm(500, lstParams$mu, lstParams$sigma)
dfL <- CalcLognormalLikelihood(sample_data, c(9e3, 11e3), c(1, 2))
dfL %>% head(5) %>% knitr::kable()
library(ggplot2)
plt <- ggplot(dfL, aes(Mean, CV, z = Likelihood)) + geom_contour(bins=100) # + geom_raster(aes(fill = Likelihood))
plt


PirateGrunt/momentus documentation built on May 4, 2019, 1:07 p.m.