dndubins / quickstats Goto Github PK
View Code? Open in Web Editor NEWDescriptive statistics library for float arrays in Arduino
License: GNU General Public License v3.0
Descriptive statistics library for float arrays in Arduino
License: GNU General Public License v3.0
I was wondering before I look into it if anyone wrote a wrapper or subclass for this to handle the circular buffers and allocation, would make it easier to work with.
Just want to share updated link for the Geometric Median reference website as it is useful for understanding how to use the function and the epsilon input parameter. (Original link was in .cpp file that is now an obsolete address)
[https://bebac.at/articles/A-Rant-About-Nice-Numbers.phtml]
PDF of the website as-is today since... why not. Geometric Median is fantastic.
GeometricMedian-Primer-Rant_About_Nice_Numbers-bebeac.pdf
Equality comparison doesn't really make sense for floats since floating point values are not exact. Normally you would compare the difference towards a small value, such as:
sorted[i]-sorted[i-1] > 0.00001
The constant is usually called an epsilon and can be chosen differently depending on context.
It would probably be best to compare to the first number in the current series (sorted[i]-sorted[firstInSeries]
). And perhaps allow the user to specify the epsilon value as a function argument.
Hi just went to use the library as it has the mode function I was looking for. However, I noticed that it wasn't counting the number of times a variable was present in array correctly.
I found a fix. By adding a new variable into the mode function
int pw = 0;
Changing the If state below in the for loop
if(abs(sorted[i]-sorted[pw]) < epsilon)
And then adding the below line into the else statement
np = i;
This seemed to fix my issue. I have tested it outside what I'm trying to do so I'm not if there will be conditions that break the code.
Hope this helps
Jack
awesome lib! I am using it for a distance sensor, I wonder if I can get some advice:
mode with 0.001 gives a quite steady value, but I am afraid of if I get 0, should I add a "mean" after mode just in case? or it would be better to use gmdn? any recommendation for the third parameter considering my numbers?
Continuing this from #2
One thing I realized later was that I never test for NaN values, and they will crash the functions. I debated filtering for NaN values in the routines, but then decided that this is probably something that should be done prior to statistics.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.