Statistics::ExponentFit Function

Overload List

#SignatureDescription
1void ExponentFit(TVec *X, double &mu);Calculate parameters for exponentialy distributed values.
2void ExponentFit(TVec *X, double &mu, DewArray<double> &PCIMu, double Alpha = 0.05);Calculate parameters for exponentially distributed values.

Overload 1: void ExponentFit(TVec *X, double &mu);

Calculate parameters for exponentialy distributed values.

#NameTypeDescription
1XTVec *
2mudouble &
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;
    DewArray<double> CIMu(2);

    // first, generate 1000 randomly exp. distributed
    // numbers with parameter mu=4.13
    vec1.Size(1000);
    RandomExponent(4.13,vec1);
    // Now, extract the mu and its 95% confidence interval
    ExponentFit(vec1,resMu,CIMu);
}
Declared in Dew::Stats::Units::Statistics · Dew.Stats/Units.Statistics.h · Cross-compiler

Overload 2: void ExponentFit(TVec *X, double &mu, DewArray<double> &PCIMu, double Alpha = 0.05);

Calculate parameters for exponentially distributed values.

#NameTypeDescription
1XTVec *Stores data which is assumed to be exponentialy distributed.
2mudouble &Returns exponential distribution parameter estimator.
3PCIMuDewArray<double> &Mu (1-Alpha)*100 percent confidence interval.
4Alpha = 0.05doubleConfidence 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(1000,false);
    // first, generate 1000 randomly exponentially distributed
    // numbers with parameter mu=4.13, and default seed
    RandomExponent(4.13,vec1,-1);
    double estmu;
    DewArray<double> cimu(2);
    // Now extract the mu and its 95% confidence intervals.
    ExponentFit(vec1,estmu,cimu, 0.05);
}
See Also: RandomExponent, ExponentStat
Declared in Dew::Stats::Units::Statistics · Dew.Stats/Units.Statistics.h · Cross-compiler