Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void NormalFit(TVec X, ref Double mu, ref Double sigma) | Calculate parameters for normally distributed values. |
| 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. |
Overload 1: void NormalFit(TVec X, ref Double mu, ref Double sigma)
Calculate parameters for normally distributed values.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec | source TVec |
| 2 | mu | Double (ref) | output |
| 3 | sigma | Double (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.
| # | Name | Description |
|---|---|---|
| 1 | X | Stores data which is assumed to be normaly distributed. |
| 2 | mu | Return normal distribution parameter estimator Mu. |
| 3 | sigma | Return normal distribution parameter estimator Sigma. |
| 4 | PCIMu | Mu (1-Alpha)*100 percent confidence interval. |
| 5 | PCISigma | Sigma (1-Alpha)*100 percent confidence interval. |
| 6 | Alpha | Confidence 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