Created attachment 186746 [details] Comparison between Calc and Excel RNG's Calc has a good Random Number Generator (RNG), however it lacks 3 options that are offered by Excel's RNG: 1) Poisson distribution 2) Patterned 3) Discrete distribution (a.k.a custom distribution) Distributions (1) and (3) are very relevant in universitites when teaching Discrete Simulation and Stochastic processes. So I would like to propose the implementation of these distributions to make Calc a better choice to teach these subjects. See attached screenshots comparing the features offered by Calc and Excel.
I agree that we need to cover extra distributions. Regarding (3), the name "Discrete" is quite generic and can be a category of distributions. Wondering if there is a better name for it. https://en.wikipedia.org/wiki/Probability_distribution#Discrete_probability_distribution I couldn't find detailed info from MS Office, but here's a overview of the options: https://officetuts.net/excel/examples/random-number-generator/
Calc's Random Number Generator are defined here: https://git.libreoffice.org/core/+/refs/heads/libreoffice-7-5-3/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx#33 https://git.libreoffice.org/core/+/refs/heads/libreoffice-7-5-3/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx#214 The implementation is taken from STD library: https://en.cppreference.com/w/cpp/numeric/random
The instruction how to generate numbers with specific distribution with MS Excel is available at: https://www.youtube.com/watch?v=BWitZ9q2kuU
I have created Review for Poisson distribution: https://gerrit.libreoffice.org/c/core/+/151439
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/793cc7d2ef5967af90a6810e597e1e12bd42777c tdf#154872 Add Poisson distribution to Random Number Generators It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Commit Notification from comment #5) > Bartosz Kosiorek committed a patch related to this issue. > It has been pushed to "master": Thank you for the Poisson patch. I've just tested it and it works nicely! Tested with Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 6f67eb36d035fa3fe4103e497207452602ff993b CPU threads: 16; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb) Locale: pt-BR (pt_BR.UTF-8); UI: en-US Calc: CL threaded As for the other two distributions, I would say that the "Patterned" one is not commonly used, so we should not need to worry about it. TBH I could hardly find information about how it is supposed to work. OTOH, the "Discrete" distribution is more relevant and commonly used in discrete simulation lectures. I'm not sure if you're planning to implement it as well, but in case you do, here's a video explaining how it works in Excel: https://www.youtube.com/watch?v=emtaBhH7kf0
The "Discrete" distribution is more complex to implement (it needs additional UI changes). Fortunately the existing STD implementation is available here: https://en.cppreference.com/w/cpp/numeric/random/discrete_distribution
Poisson is in the release notes: https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F7.6&type=revision&diff=668788&oldid=668205
For now let's close it. The Poisson distribution was added to LO.
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/bb07bc0599affc52cebc346ddc330fb61b496462 tdf#154872 Add Poisson distribution entry to documentation