Trimmed mean.
the mean of all Data vector elements, excluding highest and lowest 100*alpha/2 percents of value.
Example 1
Calculate mean for given values, excluding top and bottom 7.5% i.e 15%. Uses MtxExpr, Statistics, Math387;
procedure Example;
var a: Vector;
MT : TSample;
begin
a.SetIt(false,[1, 2, 97, 98, 99, 100, 190]);
MT := MeanT(a,0.15); // MT = 79.2
end;
#include "MtxVecCpp.h"
#include "Statistics.hpp"
void __fastcall Example();
{
Vector a;
a->SetIt(false, OPENARRAY(double,(2,3,5,4)));
double MT = MeanT(a);
// MT = 79.2
}
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples
{
private void Example()
{
Vector a = new Vector(0),
a.SetIt(false, new double[] {1, 2, 97, 98, 99, 100, 190});
double MT = Statistics.MeanT(a);
// MT = 79.2
}
}