Package it.unimi.dsi.stat
Class Jackknife.AbstractStatistic
- java.lang.Object
-
- it.unimi.dsi.stat.Jackknife.AbstractStatistic
-
- All Implemented Interfaces:
Jackknife.Statistic
- Enclosing class:
- Jackknife
public abstract static class Jackknife.AbstractStatistic extends java.lang.Object implements Jackknife.Statistic
An abstract statistic with a template method that accepts an array of doubles, returns an array of doubles and handles the data conversions that are necessary to callJackknife.Statistic.compute(BigDecimal[], MathContext)
. Useful if you do not want to fiddle withBigDecimal
.
-
-
Constructor Summary
Constructors Constructor Description AbstractStatistic()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract double[]
compute(double[] sample)
java.math.BigDecimal[]
compute(java.math.BigDecimal[] bigSample, java.math.MathContext unused)
Computes the statistic.
-
-
-
Method Detail
-
compute
public abstract double[] compute(double[] sample)
-
compute
public java.math.BigDecimal[] compute(java.math.BigDecimal[] bigSample, java.math.MathContext unused)
Description copied from interface:Jackknife.Statistic
Computes the statistic.Note that the
BigDecimal
instances passed to this method are guaranteed to have a scale set by the caller. If you have to perform divisions, please use the suppliedMathContext
.- Specified by:
compute
in interfaceJackknife.Statistic
- Parameters:
bigSample
- the samples over which the statistic must be computed.unused
- the mathematical context to be used when dividing big decimals.- Returns:
- the resulting statistic.
-
-