function Moment(const X: TVec; AMean: Double; const AOrder: Integer): Double;
Moments.
| # | Name | Description |
|---|---|---|
| 1 | X | Data. An exception is raised if X vector is complex. |
| 2 | AMean | A mean value of all X vector elements. |
| 3 | AOrder | Defines the order of central moment. |
Returns: Double - the AOrder-th central moment of all X vector elements.
Examples
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;