Moments.
Example 1
Calculate the fourth moment (related to Kurtosis) Uses MtxExpr, Statistics, Math387;
procedure Example;
var a: Vector;
AMean,
M4 : TSample;
begin
a.SetIt(false,[1, 2, 7, 8]);
AMean := a.Mean;
M4 := Moment(a,AMean,4); // M4 = 94.5625
end;
#include "MtxVecCpp.h"
#include "Statistics.hpp"
void __fastcall Example();
{
Vector a;
a->SetIt(false, OPENARRAY(double,(1, 2, 7, 8)));
double amean = a->Mean();
double m4 = Moment(a,amean,4);
// m4 = 94.5625
}
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, 7, 8});
double amean = a.Mean();
double m4 = Statistics.Moment(a,amean,4);
// m4 = 94.5625
}
}