The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



MeanAbsDev


Unit:SDL_openarrays
Class: none
Declaration: [1] function MeanAbsDev (Data: TDoubleArray; Mode: integer; var CentralPoint: double): double;
[2] function MeanAbsDev (Data: TIntArray; Mode: integer; var CentralPoint: double): double;

The function MeanAbsDev calculates the mean absolute deviation from either the mean, the median or a user-defined central point. The parameter Data contains the data to be used for the calculation. The parameter Mode controls the type of the central point:
Mode central point
0 mean
1 median
2 user-defined central point

The variable parameter CentralPoint returns the calculated mean or median (Mode = 0 or 1). If Mode is set to 2 the parameter CentralPoint has to be set to the user-defined central point. The function returns the calculated mean absolute deviation.

Hint: If the Data array is empty or the Mode parameter holds an invalid value the function returns a zero value.



Last Update: 2023-Dec-10