Statistics.NormalFit Method

Overload List

#SignatureDescription
1void NormalFit(TVec X, ref Double mu, ref Double sigma)Calculate parameters for normally distributed values.
2void NormalFit(TVec X, ref Double mu, ref Double sigma, ref Double[] PCIMu, ref Double[] PCISigma, Double Alpha)Calculate parameters for normally distributed values.

Overload 1: void NormalFit(TVec X, ref Double mu, ref Double sigma)

Calculate parameters for normally distributed values.

#NameTypeDescription
1XTVecsource TVec
2muDouble (ref)output
3sigmaDouble (ref)output

Result: stored in self (calling object)

Overload 2: void NormalFit(TVec X, ref Double mu, ref Double sigma, ref Double[] PCIMu, ref Double[] PCISigma, Double Alpha)

Calculate parameters for normally distributed values.

#NameDescription
1XStores data which is assumed to be normaly distributed.
2muReturn normal distribution parameter estimator Mu.
3sigmaReturn normal distribution parameter estimator Sigma.
4PCIMuMu (1-Alpha)*100 percent confidence interval.
5PCISigmaSigma (1-Alpha)*100 percent confidence interval.
6AlphaConfidence interval percentage.

Result: stored in self (calling object)

Examples
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples;
{
    private void Example()
    {
        Vector vec1 = new Vector(0);
        // first, generate 1000 normaly distributed
        // numbers with Mu a=0.0 and Sigma =1.0
        vec1.Size(1000, false);
        StatRandom.RandomNormal(0.0, 1.0, vec1, -1);
        double resMu, resSigma;
        double[] CIMu = new double[2];
        double[] CISigma = new double[2];
        // Now extract the Mu,Sigma and their 95% confidence intervals.
        // Use at max 400 iterations and tolerance 0.0001
        Statistics.NormalFit(vec1, out resMu, out resSigma, out CIMu, out CISigma, 0.05);
    }
}
See Also: StatRandom.RandomNormal, Probabilities.NormalStat