Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pprz_stat.h File Reference

Statistics functions like variance. More...

#include "std.h"
+ Include dependency graph for pprz_stat.h:

Go to the source code of this file.

Functions

static float variance_float (float *array, int nb)
 Compute the variance of an array of values (float). More...
 
static int32_t variance_int (int32_t *array, int nb)
 Compute the variance of an array of values (integer). More...
 

Detailed Description

Statistics functions like variance.

Definition in file pprz_stat.h.

Function Documentation

static float variance_float ( float *  array,
int  nb 
)
inlinestatic

Compute the variance of an array of values (float).

The variance is a measure of how far a set of numbers is spread out V(X) = E[(X-E[X])^2] = E[X^2] - E[X]^2 where E[X] is the expected value of X

Parameters
arraypointer to an array of float
nbnumbre of values in the array, must be >0
Returns
variance

Definition at line 45 of file pprz_stat.h.

static int32_t variance_int ( int32_t array,
int  nb 
)
inlinestatic

Compute the variance of an array of values (integer).

The variance is a measure of how far a set of numbers is spread out V(X) = E[(X-E[X])^2] = E[X^2] - E[X]^2 where E[X] is the expected value of X

Parameters
arraypointer to an array of integer
nbnumbre of values in the array, must be >0
Returns
variance

Definition at line 66 of file pprz_stat.h.