## Class SampleVarianceCalculator

• java.lang.Object
• com.opengamma.strata.math.impl.statistics.descriptive.SampleVarianceCalculator
• All Implemented Interfaces:
Function<double[],​Double>

public class SampleVarianceCalculator
extends Object
implements Function<double[],​Double>
Calculates the sample variance of a series of data.

The unbiased sample variance $\mathrm{var}$ of a series $x_1, x_2, \dots, x_n$ is given by: \begin{align*} \text{var} = \frac{1}{n-1}\sum_{i=1}^{n}(x_i - \overline{x})^2 \end{align*} where $\overline{x}$ is the sample mean. For the population variance, see PopulationVarianceCalculator.

• ### Constructor Detail

• #### SampleVarianceCalculator

public SampleVarianceCalculator()
• ### Method Detail

• #### apply

public Double apply​(double[] x)
Specified by:
apply in interface Function<double[],​Double>