Stats.Mean Method
Definition
Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0
Overload List
Mean(DateTime[]) | Returns the mean of the elements of an array of DateTime values. |
Mean<T>(Vector<T>) | Returns the mean of the elements of a vector. |
Mean<T>(T[], Boolean) | Returns the mean of the elements of a read-only span. |
Mean<T>(IEnumerable<T>, Boolean) | Returns the mean of the elements of a sequence. |
Mean<T>(ReadOnlySpan<T>, Boolean) | Returns the mean of the elements of a read-only span. |
Mean(DateTime[])
Returns the mean of the elements of an array of DateTime values.
public static DateTime Mean(
DateTime[] values
)
Parameters
Return Value
DateTimeThe mean of the elements of values.
Remarks
The mean is a DateTime value.
Exceptions
Argument | values is null. |
Mean<T>(Vector<T>)
Returns the mean of the elements of a vector.
public static double Mean<T>(
this Vector<T> values
)
Parameters
- values Vector<T>
- A vector.
Type Parameters
- T
- The type of the elements of values.
Return Value
DoubleThe 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
Argument | values is null. |
Mean<T>(T[], Boolean)
Returns the mean of the elements of a read-only span.
public static double Mean<T>(
this T[] values,
bool skipMissingValues = false
)
Parameters
- values T[]
- A span.
- skipMissingValues Boolean (Optional)
- Optional. Specifies whether missing values should be excluded from the calculation. The default is false.
Type Parameters
- T
Return Value
DoubleThe 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 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).Mean<T>(IEnumerable<T>, Boolean)
Returns the mean of the elements of a sequence.
public static double Mean<T>(
IEnumerable<T> values,
bool skipMissingValues = false
)
Parameters
- values IEnumerable<T>
- An object that implements IEnumerable<Double>.
- skipMissingValues Boolean (Optional)
- Optional. Specifies whether missing values should be excluded from the calculation. The default is false.
Type Parameters
- T
Return Value
DoubleThe mean of the elements of values.
Exceptions
Argument | values is null. |
Mean<T>(ReadOnlySpan<T>, Boolean)
Returns the mean of the elements of a read-only span.
public static double Mean<T>(
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.
Return Value
DoubleThe mean of the elements of values.