Class DiscreteQuantileMethod
- java.lang.Object
-
- com.opengamma.strata.math.impl.statistics.descriptive.QuantileCalculationMethod
-
- com.opengamma.strata.math.impl.statistics.descriptive.DiscreteQuantileMethod
-
- Direct Known Subclasses:
IndexAboveQuantileMethod
,NearestIndexQuantileMethod
,SamplePlusOneNearestIndexQuantileMethod
public abstract class DiscreteQuantileMethod extends QuantileCalculationMethod
Implementation of a quantile estimator.The estimation is one of the sorted sample data.
Reference: Value-At-Risk, OpenGamma Documentation 31, Version 0.1, April 2015.
-
-
Constructor Summary
Constructors Constructor Description DiscreteQuantileMethod()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected QuantileResult
expectedShortfall(double level, DoubleArray sample)
Computed the expected shortfall.protected QuantileResult
quantile(double level, DoubleArray sample, boolean isExtrapolated)
Computed the quantile.-
Methods inherited from class com.opengamma.strata.math.impl.statistics.descriptive.QuantileCalculationMethod
checkIndex, expectedShortfallFromSorted, expectedShortfallFromUnsorted, expectedShortfallResultFromUnsorted, quantileFromSorted, quantileFromUnsorted, quantileResultFromUnsorted, quantileResultWithExtrapolationFromUnsorted, quantileWithExtrapolationFromSorted, quantileWithExtrapolationFromUnsorted
-
-
-
-
Method Detail
-
quantile
protected QuantileResult quantile(double level, DoubleArray sample, boolean isExtrapolated)
Description copied from class:QuantileCalculationMethod
Computed the quantile.This protected method should be implemented in subclasses.
- Specified by:
quantile
in classQuantileCalculationMethod
- Parameters:
level
- the quantile levelsample
- the sample observationsisExtrapolated
- extrapolated if true, not extrapolated otherwise.- Returns:
- the quantile
-
expectedShortfall
protected QuantileResult expectedShortfall(double level, DoubleArray sample)
Description copied from class:QuantileCalculationMethod
Computed the expected shortfall.This protected method should be implemented in subclasses and coherent to
QuantileCalculationMethod.quantile(double, DoubleArray, boolean)
.- Specified by:
expectedShortfall
in classQuantileCalculationMethod
- Parameters:
level
- the quantile levelsample
- the sample observations- Returns:
- the expected shortfall
-
-