使用经验法则估计有多少值低于特定偏差

Estimate how many values fall below a specific deviation using the empirical rule

我正在尝试估计有多少值落在标准偏差的一部分内。使用经验法则我们可以声明:

34% 的值将落在平均值和 1 个标准差之间 所有值的 13.4% 将落在 1 到 2 之间。

如图所示:

此规则只能告诉我落在整数标准差范围内的值的百分比,但我正在尝试计算有多少落在标准差的分数范围内。让我们举个例子:

public decimal GetEastimatedNumberOfValuesWithinDistribution(int sampleSize, decimal average, decimal deviation, decimal newDataPoint)
{
    var priceDifferential = newDataPoint/sampleSize;
    var newAverage = average + priceDifferential;
    var averageDistance = average - newAverage;
    var fractionalDeviation = averageDistance / deviation;
    //How do I return the average number of points between that fall within the average to the newAverage
}

通常情况下,如果我有完整的数据集,我可以对其进行迭代并手动检查,但是在这种情况下,我只有关于数据集的信息,而不是所有数据。

如何估计将落在偏差的一小部分内的数据点数量?

对于正态分布,落在平均值 k⋅σ 范围内的值的百分比为 given by erf(k/sqrt(2)) where erf is the error function. For example, erf(1/sqrt(2)) = 0.682689.. and erf(3/sqrt(2)) = 0.997300..

C# 没有内置到数学包中的 erf 函数(与 SO 上的 python). Numerical approximations can be found on wikipedia, or what reference should I use to use erf 不同。