GY-63_MS5611/libraries/Statistic
2021-12-28 16:28:44 +01:00
..
.github/workflows 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
examples 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
test 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
.arduino-ci.yml 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
FAQ.md 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
keywords.txt 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
library.json 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
library.properties 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
LICENSE 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
README.md 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
Statistic.cpp 0.4.4 Statistic 2021-12-28 16:28:44 +01:00
Statistic.h 0.4.4 Statistic 2021-12-28 16:28:44 +01:00

Arduino CI Arduino-lint Arduino-lint License: MIT GitHub release

Statistic

Statistic library for Arduino includes sum, average, variance and standard deviation.

Description

The statistic library is made to get basic statistical information from a one dimensional set of data, e.g. a stream of values of a sensor.

The stability of the formulas is improved by the help of Gil Ross (Thanks!)

Interface

  • Statistic(bool useStdDev = true) Constructor, default use the standard deviation. functions. Setting this flag to false reduces math so slight increase of performance.
  • void clear(bool useStdDev = true) resets all variables.
  • float add(float value) (since 0.4.3) returns value actually added to internal sum. If this is (much) different from what should be added it might become time to call clear().
  • uint32_t count() returns zero if count == zero (of course).
  • float sum() returns zero if count == zero.
  • float minimum() returns zero if count == zero.
  • float maximum() returns zero if count == zero.
  • float average() returns NAN if count == zero.

These three functions only work if useStdDev == true

  • variance() returns NAN if count == zero.
  • pop_stdev() population stdev, returns NAN if count == zero.
  • unbiased_stdev() returns NAN if count == zero.

Operational

See examples.

Faq

See faq.md

Future

  • update documentation
    • links that explain statistics in more depth
  • derived classes
    • 32 bit with fixed sign version?
    • 64 bit with fixed sign version?
    • double version?
  • create releaseNotes.md