Stats.MeanAs Method

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

MeanAs<T, TResult>(Vector<T>) Returns the mean of the elements of a vector.
MeanAs<T, TResult>(ReadOnlySpan<T>, Boolean) Returns the mean of the elements of a read-only span as a value of the specified type.

MeanAs<T, TResult>(Vector<T>)

Returns the mean of the elements of a vector.
C#
public static TResult MeanAs<T, TResult>(
	this Vector<T> values
)

Parameters

values  Vector<T>
A vector.

Type Parameters

T
The type of the elements of values.
TResult
The type of the result.

Return Value

TResult
The 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<T>. 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).

Exceptions

ArgumentNullException

values is null.

MeanAs<T, TResult>(ReadOnlySpan<T>, Boolean)

Returns the mean of the elements of a read-only span as a value of the specified type.
C#
public static TResult MeanAs<T, TResult>(
	this ReadOnlySpan<T> values,
	bool skipMissingValues = false
)

Parameters

values  ReadOnlySpan<T>
A read-only span.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the calculation. The default is false.

Type Parameters

T
The type of the elements of values.
TResult
The type of the result.

Return Value

TResult
The mean of the elements of values computed by converting the elements to type TResult first.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ReadOnlySpan<T>. 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).

See Also