Code Monkey home page Code Monkey logo

simplestatisticsarduino's Introduction

SimpleStatisticsArduino     Buy Me a Coffee at ko-fi.com

Library to calculate basic statistics in arduino.

Create

Statistics st = Statistics();

Statistics is used for a single variable

Statistics2 st = Statistics2();

Statistics2 is used for two variables

Error st = Error();

Error useful to measure estiamtion error

Statistics - Methods

void add(double value); 

Add sample to statistics

double samples(); 

Number of samples added

double mean();  

Mean

double var(); 

Variance

double std();  

Standard deviation

double minimum(); 

Minimun value added

double maximum(); 

Maximun value added

double center(); 

Calculate center = (maximun-minimun)/2

double sum();

Aproximation to sum of all values added

double minMaxNormalization(double value);

Normalizate value using minmax normalization

double meanNormalization(double value);

Normalizate value using mean normalization

double standardization(double value);

Standardization of value (Z-score)

double rootMeanSquare();

Root mean square

double geometricMean();

Geometric mean

double harmonicMean();

Harmonic mean

double coefficientOfVariation();

Coefficient of variation

double indexOfDispersion();

Index Of Dispersion

double zeroCrossing();

Zero crossing

double zeroCrossingRate();

Zero crossing Rate = zeroCrossing()/samples()

void reset();  

Reset values.

Statistics2 - Methods

void add(double x, double y); 

Add samples to statistics

double correlation(); 

Calculate correlation coefficient between X and Y (use Pearson's correlation)

double pearsonCorrelation();

Calculate Pearson's correlation coefficient between X and Y

double spearmanCorrelation(); 

Calculate Spearman's correlation coefficient between X and Y (aproximation using Pearson, valid with more of 20 samples)

double covar();

Calculate covariance

double calculateLinearRegression(double x);

Calculate linear regression. Estimates y value from parameter x

void parametersLinearRegression(double values[]);

Return parameters m and b. y = m*x +b values[0] = m; values[1] = b;

void centroid(double values[]);

Calculate centroid.
values[0] = stX.center();
values[1] = stY.center();

void centerOfGravity(double values[]);

Calculate center of gravity
values[0] = stX.mean();
values[1] = stY.mean();

void centerOfMassXY();

Calculate center of mass. Use Y as mass and X as distance
sumXY()/stY.sum();

void centerOfMassXY();

Calculate center of mass. Use X as mass and Y as distance
sumXY()/stX.sum();

void sumXY();

Aproximation of summation X*Y

double samples(); 

Number of samples added

void reset();  

Reset values

Statistics stX;  

Statistics object for X values

Statistics sty;  

Statistics object for Y values

Error - Methods

void add(int ey, int y);  

Learns one example.

  • ey: value of estimated Y
  • y: value of Y

Return abs(ey-y)

double RMSE();  

Return Root mean squared error

double MSE();  

Return Mean squared error

double MAE();  

Return Mean absolute error

double total();  

Return aprox. to sum of all error

void reset();  

Reset values. Delete all values

void samples();

Return number of samples used

simplestatisticsarduino's People

Contributors

cubiwan avatar

Stargazers

Eugene Mazalov avatar Shawn A avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.