Stats.Weighted Standard Deviation Method
Definition
Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Overload List
Weighted | Returns the standard deviation of the variable with observations weighted by the specified vector. |
Weighted | Returns the standard deviation of the array with observations weighted by the specified array. |
Weighted | Returns the standard deviation of the variable with observations weighted by the specified vector. |
WeightedStandardDeviation<T>(Vector<T>, Vector<T>)
Returns the standard deviation of the variable with observations weighted by the specified vector.
public static double WeightedStandardDeviation<T>(
this Vector<T> values,
Vector<T> weights
)
Parameters
- values Vector<T>
- A vector containing the data.
- weights Vector<T>
- A vector containing the weights. May be null.
Type Parameters
- T
Return Value
DoubleThe standard deviation of the variable weighted by weights.
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).Remarks
If weights is null, the unweighted mean is returned.
Exceptions
Argument | values is null. |
Dimension | The length of weights does not equal the number of observations of the variable. |
WeightedStandardDeviation<T>(T[], T[], Boolean)
Returns the standard deviation of the array with observations weighted by the specified array.
public static double WeightedStandardDeviation<T>(
this T[] values,
T[] weights,
bool skipMissingValues = false
)
Parameters
- values T[]
- An array containing the data.
- weights T[]
- An array containing the weights.
- skipMissingValues Boolean (Optional)
- Optional. Specifies whether missing values should be excluded from the calculation. The default is false.
Type Parameters
- T
Return Value
DoubleThe standard deviation of the variable weighted by weights.
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).Remarks
If weights is null, the unweighted mean is returned.
Exceptions
Argument | values is null. |
Dimension | The length of weights does not equal the number of observations of the variable. |
WeightedStandardDeviation<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Boolean)
Returns the standard deviation of the variable with observations weighted by the specified vector.
public static double WeightedStandardDeviation<T>(
this ReadOnlySpan<T> values,
ReadOnlySpan<T> weights,
bool skipMissingValues
)
Parameters
- values ReadOnlySpan<T>
- A span containing the data.
- weights ReadOnlySpan<T>
- A span containing the weights.
- skipMissingValues Boolean
- Optional. Specifies whether missing values should be excluded from the calculation. The default is false.
Type Parameters
- T
Return Value
DoubleThe standard deviation of the variable weighted by weights.
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).Remarks
If weights is null, the unweighted mean is returned.
Exceptions
Dimension | The length of weights does not equal the number of observations of the variable. |