Closed
Description
Power mean
A power mean (or generalised mean) is a mean of the form
where all x are >= 0.
Source: Statistics How To & Wolfram MathWorld
function PowerMean(const A: array of Extended; Lambda: Extended): Extended;
begin
Assert(not IsZero(Lambda));
Assert(Length(A) > 0);
var Sum: Extended := 0.0;
for var X in A do
begin
Assert(Sign(X) <> NegativeValue);
Sum := Sum + Power(X, Lambda);
end;
Result := Power(Sum / Length(A), 1 / Lambda);
end;
Weighted power mean
There's also the weighted power mean:
When all weights w sum to 1 then denominator is 1 and can be ignored.
Source: Statistics How To and Wikipedia
This issue was extracted from issue #16
Metadata
Metadata
Assignees
Projects
Status
Completed