Peter Johnson

Results 186 comments of Peter Johnson

***Not to be fixed - project archived***

Once this is done the releases can be renamed since there's no need to explicitly specify which collection the releases relate to.

Median: middle value after sorting - if even number of elements then take mean of middle two => Median of integer array has to return float since mean of two...

Note that Delphi's `Math` unit has a `Mean` function, but only for Float arrays: ```pascal function Mean(const Data: array of Single): Single; function Mean(const Data: array of Double): Double; function...

Also, there is geometric mean: > The geometric mean, sometimes also called geometric average, is an average calculated by multiplying a set of positive values and taking the nth root,...

And there's the [logarithmic mean](https://en.m.wikipedia.org/wiki/Logarithmic_mean) of two +ve numbers (not same as log-mean), which is defined as: Where x = y: Mlm(x, y) = x Where x ≠ y: Mlm(x,...

Generalised Mean / Power Mean: A power mean is a mean of the form ![image](https://github.com/delphidabbler/code-snippets/assets/5164283/9edcd52e-dca2-4f66-81e2-821a1d0684e4) where all x are >= 0. Source: [Statistics How To](https://www.statisticshowto.com/power-mean-generalized-mean/) & [Wolfram MathWorld](https://mathworld.wolfram.com/PowerMean.html) ```pascal function...

Weighted Generalised Mean / Power Mean ![Screenshot_20230719-204835_Chrome~2](https://github.com/delphidabbler/code-snippets/assets/5164283/0a4d2fd2-4578-4e80-a8d0-ddfd165a7e20) When all weights w sum to 1 then denominator is 1 and can be ignored. Soure: [Statistics How To](https://www.statisticshowto.com/power-mean-generalized-mean/) and [Wikipedia](https://en.m.wikipedia.org/wiki/Generalized_mean#:~:text=In%20mathematics%2C%20generalized%20means%20(or,geometric%2C%20and%20harmonic%20means).)

Weighted geometric mean ![Screenshot_20230719-205701_Chrome](https://github.com/delphidabbler/code-snippets/assets/5164283/0b4fa811-ec55-4406-8cdf-a38b7d86e2d1) Source: [Wikipedia](https://en.m.wikipedia.org/wiki/Weighted_geometric_mean)