Stats.HarmonicMean Method

Definition

Namespace: Extreme.Statistics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

HarmonicMean(Double[]) Returns the harmonic mean of the elements of an array.
HarmonicMean(Int32[]) Returns the harmonic mean of the elements of an array.
HarmonicMean(Vector<Double>) Returns the harmonic mean of the elements of a vector.
HarmonicMean<T>(Vector<T>) Returns the harmonic mean of the elements of a numerical variable.

Stats.HarmonicMean(Double[])

Returns the harmonic mean of the elements of an array.
C#
public static double HarmonicMean(
	double[] values
)

Parameters

values  Double[]
A Double array.

Return Value

Double
The harmonic mean of the elements of values.

Remarks

The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the values values.

Exceptions

ArgumentNullExceptionvalues is null.

Stats.HarmonicMean(Int32[])

Returns the harmonic mean of the elements of an array.
C#
public static double HarmonicMean(
	int[] values
)

Parameters

values  Int32[]
An Int32 array.

Return Value

Double
The harmonic mean of the elements of values.

Remarks

The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the values values.

The harmonic mean is a Double value.

Exceptions

ArgumentNullExceptionvalues is null.

Stats.HarmonicMean(Vector<Double>)

Returns the harmonic mean of the elements of a vector.
C#
public static double HarmonicMean(
	this Vector<double> values
)

Parameters

values  Vector<Double>
A vector.

Return Value

Double
The harmonic mean of the elements of values.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<Double>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the values values.

Exceptions

ArgumentNullExceptionvalues is null.

Stats.HarmonicMean<T>(Vector<T>)

Returns the harmonic mean of the elements of a numerical variable.
C#
public static double HarmonicMean<T>(
	Vector<T> values
)

Parameters

values  Vector<T>
A Vector<T>.

Type Parameters

T

Return Value

Double
The harmonic mean of the elements of values.

Remarks

The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the values values.

Exceptions

ArgumentNullExceptionvalues is null.

See Also