Calculates the weighted average of the given data.
Namespace:
CenterSpace.NMath.StatsAssembly: NMathStats (in NMathStats.dll) Version: 3.4.0.0
Syntax
| C# |
|---|
public static double WeightedMean( int[] data, int[] weights ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function WeightedMean ( _ data As Integer(), _ weights As Integer() _ ) As Double |
| Visual C++ |
|---|
public: static double WeightedMean( array<int>^ data, array<int>^ weights ) |
Parameters
- data
- Type: array<
System..::.Int32
>[]()[]
An array.
- weights
- Type: array<
System..::.Int32
>[]()[]
An array of weights.
Return Value
Weighted mean.
Exceptions
| Exception | Condition |
|---|---|
| CenterSpace.NMath.Core..::.MismatchedSizeException | Thrown if data and weights do not have the same length. |