Standard Normal Distribution z-value function in C#

前端 未结 5 930
日久生厌
日久生厌 2021-02-05 08:04

I been looking at the recent blog post by Jeff Atwood on Alternate Sorting Orders. I tried to convert the code in the post to C# but I ran into an issue. There is no function in

5条回答
  •  余生分开走
    2021-02-05 08:32

    if you are using Math.Net then you can just use the InverseCumulativeDistribution function.

    So if you want the Z-value, where 80% of the Standard Normal curve is covered the code would look something like this

    var curve = new MathNet.Numerics.Distributions.Normal();
    var z_value = curve.InverseCumulativeDistribution(0.8);
    Console.WriteLine(z_value);
    

    Ensure that you have installed the MathNet.Numerics NuGet package.

提交回复
热议问题