create_random_distribution: add new option "log10_norm"
Closed this issue · 1 comments
mrustl commented
After discussion of @wseis with @PatrickSmeetsKWR it was decided to use a log10 normal distribution with a standard deviation (based on the 90th percentile) and mean as defined in the example code below:
inflow_pathogens_per_litre_min <- 0
inflow_pathogens_per_litre_max <- 1000
inflow_log10_mean <- (log10(inflow_pathogens_per_litre_min) + log10(inflow_pathogens_per_litre_max))/2
inflow_log10_sdev <- (log10(inflow_pathogens_per_litre_max) - inflow_log10_mean)/qnorm(0.9)
hist(10^rnorm(10000, mean = inflow_log10_mean , sd= inflow_log10_sdev))
This function should be only used for the inflow concentrations.
mrustl commented
Now the new functionality is in the R package @daniel-wicke @PatrickSmeetsKWR @wseis
Checkout the documentation for details: https://kwb-r.github.io/kwb.qmra/reference/create_random_distribution.html
@wseis please check whether it is correctly implemented:
remotes::install_github("kwb-r/kwb.qmra")
inflow <- kwb.qmra::create_random_distribution(type = "log10_norm", min = 0, max = 1000)
Create 1 random distribution(s): 10^rnorm(with parameters n: 365, mean: 0.500000, sd: 1.950760)
summary(inflow$events$values)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.0 0.2 4.1 10616.1 112.0 2440307.9