how to generate a gaussian distribution using mysql user-defined function

前端 未结 3 1907
南方客
南方客 2020-12-20 22:39

I like to use MySQL to do quantitative analysis and statistics. I would like to make a MySQL user-defined function of the form: sample_gaussian(mean, stdev) that returns a s

3条回答
  •  失恋的感觉
    2020-12-20 23:24

    The Box-Muller transform is a way to generate standard normal random variates using elementary functions. It generates two at a time, which is sometimes wasteful, but I find it very elegant.

提交回复
热议问题