Top Description Methods
org.apache.commons.math3.stat.descriptive

public Interface WeightedEvaluation

Known Direct Implementers
org.apache.commons.math3.stat.descriptive.moment.Mean, org.apache.commons.math3.stat.descriptive.moment.Variance, org.apache.commons.math3.stat.descriptive.summary.Product
Imports
org.apache.commons.math3.exception.MathIllegalArgumentException

Weighted evaluation for statistics.
Since
2.1

Method Summary

Modifier and TypeMethod and Description
public double

Returns:

the value of the weighted statistic applied to the input array
evaluate
(double[]
input array
values
,
double[]
array of weights
weights
)

Returns the result of evaluating the statistic over the input array, using the supplied weights.

public double

Returns:

the value of the weighted statistic applied to the included array entries
evaluate
(double[]
the input array
values
,
double[]
array of weights
weights
,
int
the index of the first element to include
begin
,
int
the number of elements to include
length
)

Returns the result of evaluating the statistic over the specified entries in the input array, using corresponding entries in the supplied weights array.

Method Detail

evaluateback to summary
public double evaluate(double[] values, double[] weights) throws MathIllegalArgumentException

Returns the result of evaluating the statistic over the input array, using the supplied weights.

Parameters
values:double[]

input array

weights:double[]

array of weights

Returns:double

the value of the weighted statistic applied to the input array

Exceptions
MathIllegalArgumentException:
if either array is null, lengths do not match, weights contain NaN, negative or infinite values, or weights does not include at least on positive value
evaluateback to summary
public double evaluate(double[] values, double[] weights, int begin, int length) throws MathIllegalArgumentException

Returns the result of evaluating the statistic over the specified entries in the input array, using corresponding entries in the supplied weights array.

Parameters
values:double[]

the input array

weights:double[]

array of weights

begin:int

the index of the first element to include

length:int

the number of elements to include

Returns:double

the value of the weighted statistic applied to the included array entries

Exceptions
MathIllegalArgumentException:
if either array is null, lengths do not match, indices are invalid, weights contain NaN, negative or infinite values, or weights does not include at least on positive value