Non-uniform randomness in Erlang? (as a feature)
Sergey Prokhorov
seriy.pr@REDACTED
Tue Jan 25 14:56:45 CET 2022
Hi,
I'm not sure I fully understand the terminology, but did I understand
correctly that you are looking for some "random choice with weights"?
I have implemented the "walker alias" algorithm some time ago
https://gist.github.com/seriyps/5593193
But it is more or less a direct translation from imperative code, so it
does not look really idiomatic.
And it also only returns values from a predefined finite set, not via
arbitrary density function.
> Hi,
>
> A bit in link with the recent message of Kenji regarding
> state-of-the-art random generators: if needing to draw samples from,
> this time, a specific, non-uniform distribution, are there Erlang
> libraries able to accept as input such a user-specified, arbitrary
> probability density function?
>
> (I searched for "Inverse transform sampling in Erlang" and alike, yet,
> because of the statistical distribution of the same name, pointers are
> difficult to find)
>
> Thanks in advance for any information,
>
> Best regards,
>
> Olivier.
>
> --
>
> Olivier Boudeville
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20220125/d8e487a3/attachment.htm>
More information about the erlang-questions
mailing list