Moments.
function Moment(const X: TVec; AMean: double; const AOrder: Integer): double;
Parameters |
Description |
X |
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. |
the AOrder-th central moment of all X vector elements.
Calculate the fourth moment (related to Kurtosis)
Uses MtxExpr, Statistics, Math387; procedure Example; var a: Vector; AMean, M4 : double; begin a.SetIt(false,[1, 2, 7, 8]); AMean := a.Mean; M4 := Moment(a,AMean,4); // M4 = 94.5625 end;
#include "MtxExpr.hpp" #include "Statistics.hpp" void __fastcall Example() { sVector a; a.SetIt(false, OPENARRAY(double,(1, 2, 7, 8))); double amean = a.Mean(); double m4 = Moment(a,amean,4); // m4 = 94.5625 }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|
What do you think about this topic? Send feedback!
|