Statistics::MeanT Function

double MeanT(TVec *Data, double Alpha = 0.05);

Trimmed mean.

#NameTypeDescription
1DataTVec *Data. An exception is raised if Data vector is complex.
2Alpha = 0.05doubleDefines the percent of value excluded from mean calculation. If Alpha parameter is omitted, the default value 0.05 is used (meaning highest 2.5% and lowest 2.5% of data will be excluded). Alpha paramater must lie on the interval [0,1) otherwise an exception is raised.

Returns: the mean of all Data vector elements, excluding highest and lowest 100*Alpha/2 percents of value.

Examples
#include "MtxExpr.h"
#include "Units.Statistics.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::Statistics;

void Example()
{
    Vector a(0);
    a.SetIt(false, DewArray<double>{1, 2, 97, 98, 99, 100, 190});
    double MT = MeanT(a,0.5);
    // MT = 79.2
}
See Also: Statistics::MeanH, Statistics::MeanG
Declared in Dew::Stats::Units::Statistics · Dew.Stats/Units.Statistics.h · Cross-compiler