double Moment(TVec *X, double AMean, const int AOrder);
Moments.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec * | Data. An exception is raised if X vector is complex. |
| 2 | AMean | double | A mean value of all X vector elements. |
| 3 | AOrder | const int | Defines the order of central moment. |
Returns: the AOrder-th central moment of all X vector elements.
Examples
#include "MtxExpr.h"
#include "Units.Statistics.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::Statistics;
void Example()
{
Vector a(0);
a.SetIt(false, DewArray<double>{1, 2, 7, 8});
double amean = a.Mean();
double m4 = Moment(a,amean,4);
// m4 = 94.5625
}
Declared in Dew::Stats::Units::Statistics · Dew.Stats/Units.Statistics.h · Cross-compiler