Paparazzi UAS  v5.12_stable-4-g9b43e9b
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. More...

#include "std.h"
+ Include dependency graph for pprz_stat.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int32_t mean_i (int32_t *array, uint32_t n_elements)
 Compute the mean value of an array This is implemented using floats to handle scaling of all variables. More...
 
int32_t variance_i (int32_t *array, uint32_t n_elements)
 Compute the variance of an array of values (integer). More...
 
int32_t covariance_i (int32_t *array1, int32_t *array2, uint32_t n_elements)
 Compute the covariance of two arrays V(X) = E[(X-E[X])(Y-E[Y])] = E[XY] - E[X]E[Y] where E[X] is the expected value of X This is implemented using floats to handle scaling of all variables. More...
 
float mean_f (float *arr, uint32_t n_elements)
 Compute the mean value of an array (float) More...
 
float variance_f (float *array, uint32_t n_elements)
 Compute the variance of an array of values (float). More...
 
float covariance_f (float *array1, float *array2, uint32_t n_elements)
 Compute the covariance of two arrays V(X) = E[(X-E[X])(Y-E[Y])] = E[XY] - E[X]E[Y] where E[X] is the expected value of X. More...
 

Detailed Description

Statistics functions.

Definition in file pprz_stat.h.

Function Documentation

float covariance_f ( float *  arr1,
float *  arr2,
uint32_t  n_elements 
)

Compute the covariance of two arrays V(X) = E[(X-E[X])(Y-E[Y])] = E[XY] - E[X]E[Y] where E[X] is the expected value of X.

Parameters
[in]*array1The first array
[in]*array2The second array
[in]n_elementsNumber of elements in the arrays
Returns
covariance

Definition at line 132 of file pprz_stat.c.

Referenced by set_cov_div(), and variance_f().

+ Here is the caller graph for this function:

int32_t covariance_i ( int32_t array1,
int32_t array2,
uint32_t  n_elements 
)

Compute the covariance of two arrays V(X) = E[(X-E[X])(Y-E[Y])] = E[XY] - E[X]E[Y] where E[X] is the expected value of X This is implemented using floats to handle scaling of all variables.

Parameters
[in]*array1The first array
[in]*array2The second array
[in]n_elementsNumber of elements in the arrays
Returns
covariance

Definition at line 74 of file pprz_stat.c.

Referenced by variance_i().

+ Here is the caller graph for this function:

float mean_f ( float *  array,
uint32_t  n_elements 
)

Compute the mean value of an array (float)

Parameters
[in]*arrayThe array
[in]n_elementsNumber of elements in the array
Returns
mean

Definition at line 99 of file pprz_stat.c.

int32_t mean_i ( int32_t array,
uint32_t  n_elements 
)

Compute the mean value of an array This is implemented using floats to handle scaling of all variables.

Parameters
[in]*arrayThe array
[in]n_elementsNumber of elements in the array
Returns
mean

Definition at line 39 of file pprz_stat.c.

float variance_f ( float *  array,
uint32_t  n_elements 
)

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
n_elementsNumber of values in the array
Returns
variance

Definition at line 119 of file pprz_stat.c.

References covariance_f().

+ Here is the call graph for this function:

int32_t variance_i ( int32_t array,
uint32_t  n_elements 
)

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 This is implemented using floats to handle scaling of all variables

Parameters
arraypointer to an array of integer
n_elementsnumber of elements in the array
Returns
variance

Definition at line 60 of file pprz_stat.c.

References covariance_i().

+ Here is the call graph for this function: