从F#中的正态分布中绘制值

Dr *_*ius 4 f# normal-distribution

如何从F#中的指定正态分布中获取随机值?

我想要类似于Python的x = numpy.random.normal(mean,standard_deviation),但是在F#中.

小智 5

例如,您可以使用Math.NET Numerics库.

open MathNet.Numerics.Distributions

let normalDist = new Normal(mean, stddev)
normalDist.Sample()
Run Code Online (Sandbox Code Playgroud)