qxLib
Classes | Functions
moving_average.h File Reference
#include <qx/easing/easing_functions.h>
#include <deque>
#include <vector>
#include <qx/stat/moving_average.inl>

Go to the source code of this file.

Classes

class  qx::moving_average< T >
 Moving average is the unweighted mean of the previous K entries. More...
 

Functions

template<class T >
std::vector< T > qx::get_moving_average_simple_weights (size_t nEntries)
 Generate weights for moving_average as arithmetic mean. More...
 
template<class T >
std::vector< T > qx::get_moving_average_linear_weights (size_t nEntries)
 Generate weights for moving_average with linearly decrease, from highest weight for the most recent data, down to zero. More...
 
template<class T >
std::vector< T > qx::get_moving_average_exp_weights (size_t nEntries)
 Generate weights for moving_average with exponential decrease, from highest weight for the most recent data, down to zero. More...
 

Detailed Description

Author
Khrapov
Date
1.06.2021

Definition in file moving_average.h.

Function Documentation

◆ get_moving_average_exp_weights()

template<class T >
std::vector< T > qx::get_moving_average_exp_weights ( size_t  nEntries)
inline

Generate weights for moving_average with exponential decrease, from highest weight for the most recent data, down to zero.

Template Parameters
T- floating point ish type
Parameters
nEntries- number of entries in moving_average
Return values
-weights

Definition at line 33 of file moving_average.inl.

◆ get_moving_average_linear_weights()

template<class T >
std::vector< T > qx::get_moving_average_linear_weights ( size_t  nEntries)
inline

Generate weights for moving_average with linearly decrease, from highest weight for the most recent data, down to zero.

Template Parameters
T- floating point ish type
Parameters
nEntries- number of entries in moving_average
Return values
-weights

Definition at line 20 of file moving_average.inl.

◆ get_moving_average_simple_weights()

template<class T >
std::vector< T > qx::get_moving_average_simple_weights ( size_t  nEntries)
inline

Generate weights for moving_average as arithmetic mean.

Template Parameters
T- floating point ish type
Parameters
nEntries- number of entries in moving_average
Return values
-weights

Definition at line 14 of file moving_average.inl.