added comment for more direct wikipedia citation

This commit is contained in:
Quinn Dougherty 2022-06-27 14:37:12 -04:00
parent 14189fd848
commit 54cd636524

View File

@ -133,6 +133,7 @@ module Beta = {
} }
let fromMeanAndStdev = (mean, stdev) => { let fromMeanAndStdev = (mean, stdev) => {
// https://en.wikipedia.org/wiki/Beta_distribution#Mean_and_variance
let var = stdev *. stdev let var = stdev *. stdev
let sampleSize = mean *. (1.0 -. mean) /. var let sampleSize = mean *. (1.0 -. mean) /. var
mean->fromMeanAndSampleSize(sampleSize) mean->fromMeanAndSampleSize(sampleSize)