本文介绍了在C#标准正态分布z值函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找在最近的一篇博客杰夫·阿特伍德在。我试图将代码转换在后,以C#,但我遇到了一个问题。目前在.NET中没有的功能,我知道这将返回z值,给定区域的标准正态曲线下的百分比。推荐值使用的算法有95%和97.5%。其中,你可以看一下在任何统计本书的Z值表。

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 .NET that I know of that will return the z-value, given the percentage of area under the standard normal curve. The recommended values to use for the algorithm are 95% and 97.5% which you can look up on the z-value table in any statistics book.

有谁知道如何实施用于z的所有的值或平均值至少6个标准偏差这样的功能。一种方法是将硬编码的值成一个字典,并使用一个查找但必须有计算的确切值的一种方式。
我在解决这一尝试是取标准正态曲线函数的定积分。

Does anyone know how to implement such a function for all values of z or at least to 6 standard deviations from the mean. One way would be to hard code the values into a dictionary and use a look up but there has to be a way of calculating the exact value.My attempt at solving this was to take a definite integral of the standard normal curve function.

Y =(1 /(SQRT(2 * PI)) )* E ^( - (1/2)* X ^ 2)

y = (1 / (sqrt(2 * PI))) * e^(-(1/2) * x^2)

这给了我两个X值之间的曲线下面积但后来我坚持...也许我基地的方式,这是不是你会怎么做呢?

This gives me the area under the curve between two x values but then I am stuck… Maybe I am way of base and this is not how you would do it?

感谢。

推荐答案

下面是用Python编写的正态分布一些,但它可以很容易地被翻译C#中加入一些标点符号。它的代码只是约15行。

Here's some code for the normal distribution written in Python, but it could easily be translated to C# by adding some punctuation. It's just about 15 lines of code.

这篇关于在C#标准正态分布z值函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 14:33