Dew Stats Master .NET
Moment Routine
Summary
Moments.

Unit
Statistics

Declaration
Function Moment(X: TVec; AMean: TSample; const AOrder: Integer): TSample;
 Parameter  Description 
Data. An exception is raised if X vector is complex. 
AMean A mean value of all X vector elements. 
AOrder Defines the order of central moment. 
Result
the AOrder-th central moment of all X vector elements.
Categories
Descriptive statistics routines

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 } }

Copyright 2008 Dew Research
http://www.dewresearch.com