Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void NormalFit(TVec *X, double &mu, double &sigma); | Calculate parameters for normally distributed values. |
| 2 | void NormalFit(TVec *X, double &mu, double &sigma, DewArray<double> &PCIMu, DewArray<double> &PCISigma, double Alpha = 0.05); | Calculate parameters for normally distributed values. |
Overload 1: void NormalFit(TVec *X, double &mu, double &sigma);
Calculate parameters for normally distributed values.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec * | |
| 2 | mu | double & | |
| 3 | sigma | double & |
Examples
#include "MtxExpr.h"
#include "Units.StatRandom.h"
#include "Units.Statistics.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::StatRandom;
using namespace Dew::Stats::Units::Statistics;
void Example()
{
Vector vec1;
double resMu, resSigma;
DewArray<double> CIMu(2), CISigma(2);
// first, generate 1000 normaly distributed
// numbers with Mu a=0.0 and Sigma =1.0
vec1.Size(1000);
RandomNormal(0.0,1.0,vec1);
// Now extract the Mu,Sigma and their 95% confidence intervals.
NormalFit(vec1,resMu,resSigma,CIMu,CISigma);
}
Declared in Dew::Stats::Units::Statistics · Dew.Stats/Units.Statistics.h · Cross-compiler
Overload 2: void NormalFit(TVec *X, double &mu, double &sigma, DewArray<double> &PCIMu, DewArray<double> &PCISigma, double Alpha = 0.05);
Calculate parameters for normally distributed values.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec * | Stores data which is assumed to be normaly distributed. |
| 2 | mu | double & | Return normal distribution parameter estimator Mu. |
| 3 | sigma | double & | Return normal distribution parameter estimator Sigma. |
| 4 | PCIMu | DewArray<double> & | Mu (1-Alpha)*100 percent confidence interval. |
| 5 | PCISigma | DewArray<double> & | Sigma (1-Alpha)*100 percent confidence interval. |
| 6 | Alpha = 0.05 | double | Confidence interval percentage. |
Examples
#include "MtxExpr.h"
#include "Units.StatRandom.h"
#include "Units.Statistics.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::StatRandom;
using namespace Dew::Stats::Units::Statistics;
void Example()
{
Vector vec1(0);
// first, generate 1000 normaly distributed
// numbers with Mu a=0.0 and Sigma =1.0
vec1.Size(1000, false);
RandomNormal(0.0, 1.0, vec1, -1);
double resMu, resSigma;
DewArray<double> CIMu(2);
DewArray<double> CISigma(2);
// Now extract the Mu,Sigma and their 95% confidence intervals.
// Use at max 400 iterations and tolerance 0.0001
NormalFit(vec1, resMu, resSigma, CIMu, CISigma, 0.05);
}
See Also: RandomNormal, NormalStat
Declared in Dew::Stats::Units::Statistics · Dew.Stats/Units.Statistics.h · Cross-compiler