Advanced Analysis Library Only
AnalysisLibErrType Moment (double inputArray[], int numberOfElements, int order, double *moment);
Calculates the moment about the mean of the input array with the specified order. Moment uses the following formulas to find the moment:
where
/* Generate an array with random numbers and determine its skewness (third-order moment) and its kurtosis (fourth-order moment). */
double x[200], skew, kurtosis;
n, order;
n = 200;
Uniform (n, 17, x);
order = 3;
Moment (x, n, order, &skew);
order = 4;
Moment (x, n, order, &kurtosis);
Input | ||||
Name | Type | Description | ||
inputArray | double-precision array | Input array used to compute the moment about the mean. | ||
numberOfElements | integer | Number of elements used to compute the moment about the mean. | ||
order | integer | Moment order.
Default Value: 3. |
||
Output | ||||
Name | Type | Description | ||
moment | double-precision | Moment about the mean. |
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |