TPCCLIB
|
Calculation of median value. More...
#include "libtpcmodel.h"
Go to the source code of this file.
Functions | |
double | d_kth_smallest (double *data, int n, int k) |
double | dmedian (double *data, int n) |
double | dmean (double *data, int n, double *sd) |
double | dmean_nan (double *data, int n, double *sd, int *vn) |
Calculation of median value.
Definition in file median.c.
double d_kth_smallest | ( | double * | data, |
int | n, | ||
int | k ) |
Returns the kth smallest value in data[0..n-1]. Array is partially sorted. Algorithm is based on the book Wirth N. Algorithms + data structures = programs. Englewood Cliffs, Prentice-Hall, 1976.
data | Pointer to data; array is partially sorted. |
n | Length of data array. |
k | kth smallest value will be returned. |
Definition at line 15 of file median.c.
Referenced by dmedian().
double dmean | ( | double * | data, |
int | n, | ||
double * | sd ) |
Returns the mean in array data[0..n-1], and optionally calculates also the (sample) standard deviation of the mean.
data | Pointer to data; data is not changed in any way. |
n | Length of data array. |
sd | Pointer to variable where SD will be written; enter NULL if not needed. |
Definition at line 73 of file median.c.
double dmean_nan | ( | double * | data, |
int | n, | ||
double * | sd, | ||
int * | vn ) |
Returns the mean in array data[0..n-1], and optionally calculates also the standard deviation of the mean. Data may contain missing samples marked as NaNs.
data | Pointer to data; data is not changed in any way. |
n | Length of data array. |
sd | Pointer to variable where SD will be written; enter NULL if not needed. |
vn | Pointer to variable where number of valid (not NaN) samples will be written; enter NULL if not needed. |
Definition at line 104 of file median.c.
double dmedian | ( | double * | data, |
int | n ) |
Returns the median in array data[0..n-1]. Array is partially sorted. Algorithm is based on the book Wirth N. Algorithms + data structures = programs. Englewood Cliffs, Prentice-Hall, 1976.
data | Pointer to data; array is partially sorted. |
n | Length of data array. |
Definition at line 48 of file median.c.
Referenced by dftRobustMinMaxTAC(), least_trimmed_square(), and mEstim().