[Git][NTPsec/ntpsec][master] Fix ntpviz's formulas for skewness and kurtosis

Gary E. Miller (@garyedmundsmiller) gitlab at mg.gitlab.com
Mon Dec 9 21:04:43 UTC 2024



Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
cada0f96 by Matt Selsky at 2024-12-09T21:01:18+00:00
Fix ntpviz's formulas for skewness and kurtosis

The formula comes from
https://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm and there was
an error in our code so we calculated the difference of each value from the
standard deviation instead of the difference from the mean.

Thanks to Frank Davis for reporting the error and suggesting a fix.

- - - - -


2 changed files:

- NEWS.adoc
- ntpclients/ntpviz.py


Changes:

=====================================
NEWS.adoc
=====================================
@@ -12,6 +12,8 @@ on user-visible changes.
 
 ## Repository Head
 
+* Fix ntpviz's skewness and kurtosis formulas. Fix suggested by by Frank Davis.
+
 * ntpd now runs on FIPS mode systems.
 
 * Clock fuzzing is gone.  --disable-fuzz is now standard.


=====================================
ntpclients/ntpviz.py
=====================================
@@ -195,8 +195,8 @@ class RunningStats(object):
         m3 = 0
         m4 = 0
         for val in values:
-            m3 += pow(val - self.sigma, 3)
-            m4 += pow(val - self.sigma, 4)
+            m3 += pow(val - self.mu, 3)
+            m4 += pow(val - self.mu, 4)
 
         self.skewness = m3 / (self.num * pow(self.sigma, 3))
         self.kurtosis = m4 / (self.num * pow(self.sigma, 4))



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/cada0f9624267c1d750a301f17c09ada94be6d0a

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/cada0f9624267c1d750a301f17c09ada94be6d0a
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20241209/aa277ddb/attachment-0001.htm>


More information about the vc mailing list