WebCab Probability and Statistics Web Services for .NET v3.3 Demo

BasicStatistics.WeightedAverage Method 

Calculates the weighted average of the currently registered data set.

public double WeightedAverage(
   double[] weights
);

Parameters

weights
An array of doubles where the k-th element corresponds to the weight placed on the k-th element of the data set which has been registered.

Remarks

In order to register a new data set invoke the method SetDataSet. Note that, the length of the array's of weights must equal the number of terms within the data set which has been registered and the sum of the weights should be equal to 1.

Remark: In the case when the set of weights are {1/n, 1/n, ...., 1/n}, where n is the number of terms in the registered set, then the weighted average evaluated here is just the arithmetic mean which can be evaluated using ArithmeticMean.

Exceptions

Exception TypeCondition
StatisticsExceptionThrown if no data set has been registered for the present instance of the XML Web service.

See Also

BasicStatistics Class | Statistics Namespace | Evaluates the arithmetic mean of the registered data set. | Evaluates the geometric mean of the registered data set.