Package org.drip.measure.gamma
Class R1ShapeScaleDistribution
java.lang.Object
org.drip.measure.continuous.R1Univariate
org.drip.measure.gamma.R1ShapeScaleDistribution
- Direct Known Subclasses:
ErlangDistribution
,R1GammaToExponential
,R1GammaToMaxwellBoltzmannSquared
,R1ShapeScaleDiscrete
public class R1ShapeScaleDistribution extends R1Univariate
R1ShapeScaleDistribution implements the Shape and Scale Parameterization of the R1 Gamma
Distribution. The References are:
- Devroye, L. (1986): Non-Uniform Random Variate Generation Springer-Verlag New York
- Gamma Distribution (2019): Gamma Distribution https://en.wikipedia.org/wiki/Chi-squared_distribution
- Louzada, F., P. L. Ramos, and E. Ramos (2019): A Note on Bias of Closed-Form Estimators for the Gamma Distribution Derived From Likelihood Equations The American Statistician 73 (2) 195-199
- Minka, T. (2002): Estimating a Gamma distribution https://tminka.github.io/papers/minka-gamma.pdf
- Ye, Z. S., and N. Chen (2017): Closed-Form Estimators for the Gamma Distribution Derived from Likelihood Equations The American Statistician 71 (2) 177-181
- Module = Computational Core Module
- Library = Numerical Analysis Library
- Project = Rd Continuous/Discrete Probability Measures
- Package = R1 Gamma Distribution Implementation/Properties
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description R1ShapeScaleDistribution(ShapeScaleParameters shapeScaleParameters, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)
R1ShapeScaleDistribution Constructor -
Method Summary
Modifier and Type Method Description double
bannehekeEkayanakeMedianApproximation()
Compute the Banneheke-Ekayanake Approximation for the Median when k gte 1double
chenRubinMedianLowerBound()
Compute the Chen-Rubin Median Lower Bounddouble
chenRubinMedianUpperBound()
Compute the Chen-Rubin Median Upper BoundR1UnivariateNormal
cltProxy()
Retrieve the Central Limit Theorem Equivalent Normal Distribution Proxydouble
cumulative(double t)
Compute the cumulative under the distribution to the given valuedouble
density(double t)
Compute the Density under the Distribution at the given Variatedouble
differentialEntropy()
Retrieve the Differential Entropy of the DistributionR1ToR1
digammaEstimator()
Retrieve the Digamma Estimatordouble
excessKurtosis()
Retrieve the Excess Kurtosis of the DistributionExponentialFamilyRepresentation
exponentialFamilyRepresentation(double x)
Generate the Exponential Family RepresentationR1ToR1
gammaEstimator()
Retrieve the Gamma Estimatordouble
laplacian(double s)
Compute the Laplaciandouble
logarithmicExpectation()
Compute the Logarithmic ExpectationR2ToR1
lowerIncompleteGammaEstimator()
Retrieve the Lower Incomplete Gamma Estimatordouble
mean()
Retrieve the Mean of the Distributiondouble
mode()
Retrieve the Mode of the DistributionR1ToR1
momentGeneratingFunction()
Construct the Moment Generating Functiondouble[]
naturalParameters()
Retrieve the Array of Natural Parametersdouble[]
naturalStatistics(double x)
Retrieve the Array of Natural Statisticsdouble
ramanujanChoiMedianApproximation()
Compute the Ramanujan-Choi Approximation for the Mediandouble
randomAhrensDieter1982()
Generate a Random Variable using the Ahrens-Dieter (1982) Schemedouble
randomMarsaglia1977()
Generate a Random Variable using the Marsaglia (1977) SchemeR1ShapeScaleDistribution
scale(double scaleFactor)
Generate a Scaled Gamma Distributionstatic R1ShapeScaleDistribution
ShapeRate(double shapeParameter, double rateParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)
Construct a Gamma Distribution from Shape and Rate ParametersShapeScaleParameters
shapeScaleParameters()
Retrieve the Shape-Scale Parametersstatic R1ShapeScaleDistribution
ShapeSummation(double[] shapeParameterArray, double scaleParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)
Shape Summation Based ShapeScaleDistributiondouble
skewness()
Retrieve the Skewness of the Distributionstatic R1ShapeScaleDistribution
Standard(double shapeParameter, double scaleParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)
Construct the Standard R1ShapeScaleDistribution Instancedouble[]
support()
Lay out the Support of the PDF Rangedouble
variance()
Retrieve the Variance of the DistributionMethods inherited from class org.drip.measure.continuous.R1Univariate
bPOE, centralMoment, cvar, expectedShortfall, fisherInformation, histogram, incremental, invCumulative, iqr, kullbackLeiblerDivergence, median, nonCentralMoment, populationCentralMeasures, probabilityGeneratingFunction, quantile, random, randomArray, supported, tukeyAnomaly, tukeyCriterion
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
R1ShapeScaleDistribution
public R1ShapeScaleDistribution(ShapeScaleParameters shapeScaleParameters, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator) throws java.lang.ExceptionR1ShapeScaleDistribution Constructor- Parameters:
shapeScaleParameters
- Shape-Scale ParametersgammaEstimator
- Gamma EstimatordigammaEstimator
- Digamma EstimatorlowerIncompleteGammaEstimator
- Lower Incomplete Gamma Estimator- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
-
Method Details
-
ShapeRate
public static final R1ShapeScaleDistribution ShapeRate(double shapeParameter, double rateParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)Construct a Gamma Distribution from Shape and Rate Parameters- Parameters:
shapeParameter
- Shape ParameterrateParameter
- Rate ParametergammaEstimator
- Gamma EstimatordigammaEstimator
- Digamma EstimatorlowerIncompleteGammaEstimator
- Lower Incomplete Gamma Estimator- Returns:
- Gamma Distribution from Shape Alpha and Rate Beta Parameters
-
ShapeSummation
public static final R1ShapeScaleDistribution ShapeSummation(double[] shapeParameterArray, double scaleParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)Shape Summation Based ShapeScaleDistribution- Parameters:
shapeParameterArray
- Shape Parameter ArrayscaleParameter
- Scale ParametergammaEstimator
- Gamma EstimatordigammaEstimator
- Digamma EstimatorlowerIncompleteGammaEstimator
- Lower Incomplete Gamma Estimator- Returns:
- Shape Summation Based ShapeScaleDistribution
-
Standard
public static final R1ShapeScaleDistribution Standard(double shapeParameter, double scaleParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)Construct the Standard R1ShapeScaleDistribution Instance- Parameters:
shapeParameter
- Shape ParameterscaleParameter
- Scale ParametergammaEstimator
- Gamma EstimatordigammaEstimator
- Digamma EstimatorlowerIncompleteGammaEstimator
- Lower Incomplete Gamma Estimator- Returns:
- The R1ShapeScaleDistribution Instance
-
shapeScaleParameters
Retrieve the Shape-Scale Parameters- Returns:
- The Shape-Scale Parameters
-
gammaEstimator
Retrieve the Gamma Estimator- Returns:
- Gamma Estimator
-
digammaEstimator
Retrieve the Digamma Estimator- Returns:
- Digamma Estimator
-
lowerIncompleteGammaEstimator
Retrieve the Lower Incomplete Gamma Estimator- Returns:
- Lower Incomplete Gamma Estimator
-
support
public double[] support()Description copied from class:R1Univariate
Lay out the Support of the PDF Range- Specified by:
support
in classR1Univariate
- Returns:
- Support of the PDF Range
-
density
public double density(double t) throws java.lang.ExceptionDescription copied from class:R1Univariate
Compute the Density under the Distribution at the given Variate- Specified by:
density
in classR1Univariate
- Parameters:
t
- Variate at which the Density needs to be computed- Returns:
- The Density
- Throws:
java.lang.Exception
- Thrown if the input is invalid
-
cumulative
public double cumulative(double t) throws java.lang.ExceptionDescription copied from class:R1Univariate
Compute the cumulative under the distribution to the given value- Specified by:
cumulative
in classR1Univariate
- Parameters:
t
- Variate to which the cumulative is to be computed- Returns:
- The cumulative
- Throws:
java.lang.Exception
- Thrown if the inputs are invalid
-
mean
public double mean() throws java.lang.ExceptionDescription copied from class:R1Univariate
Retrieve the Mean of the Distribution- Specified by:
mean
in classR1Univariate
- Returns:
- The Mean of the Distribution
- Throws:
java.lang.Exception
- Thrown if the Mean cannot be estimated
-
mode
public double mode() throws java.lang.ExceptionDescription copied from class:R1Univariate
Retrieve the Mode of the Distribution- Overrides:
mode
in classR1Univariate
- Returns:
- The Mode of the Distribution
- Throws:
java.lang.Exception
- Thrown if the Mode cannot be estimated
-
variance
public double variance() throws java.lang.ExceptionDescription copied from class:R1Univariate
Retrieve the Variance of the Distribution- Specified by:
variance
in classR1Univariate
- Returns:
- The Variance of the Distribution
- Throws:
java.lang.Exception
- Thrown if the Variance cannot be estimated
-
skewness
public double skewness() throws java.lang.ExceptionDescription copied from class:R1Univariate
Retrieve the Skewness of the Distribution- Overrides:
skewness
in classR1Univariate
- Returns:
- The Skewness of the Distribution
- Throws:
java.lang.Exception
- Thrown if the Skewness cannot be estimated
-
excessKurtosis
public double excessKurtosis() throws java.lang.ExceptionDescription copied from class:R1Univariate
Retrieve the Excess Kurtosis of the Distribution- Overrides:
excessKurtosis
in classR1Univariate
- Returns:
- The Excess Kurtosis of the Distribution
- Throws:
java.lang.Exception
- Thrown if the Skewness cannot be estimated
-
differentialEntropy
public double differentialEntropy() throws java.lang.ExceptionDescription copied from class:R1Univariate
Retrieve the Differential Entropy of the Distribution- Overrides:
differentialEntropy
in classR1Univariate
- Returns:
- The Differential Entropy of the Distribution
- Throws:
java.lang.Exception
- Thrown if the Entropy cannot be estimated
-
momentGeneratingFunction
Description copied from class:R1Univariate
Construct the Moment Generating Function- Overrides:
momentGeneratingFunction
in classR1Univariate
- Returns:
- The Moment Generating Function
-
cltProxy
Retrieve the Central Limit Theorem Equivalent Normal Distribution Proxy- Returns:
- The Central Limit Theorem Equivalent Normal Distribution Proxy
-
logarithmicExpectation
public double logarithmicExpectation() throws java.lang.ExceptionCompute the Logarithmic Expectation- Returns:
- The Logarithmic Expectation
- Throws:
java.lang.Exception
- Thrown if the Logarithmic Expectation cannot be computed
-
bannehekeEkayanakeMedianApproximation
public double bannehekeEkayanakeMedianApproximation() throws java.lang.ExceptionCompute the Banneheke-Ekayanake Approximation for the Median when k gte 1- Returns:
- The Banneheke-Ekayanake Approximation for the Median
- Throws:
java.lang.Exception
- Thrown if the Median cannot be computed
-
ramanujanChoiMedianApproximation
public double ramanujanChoiMedianApproximation()Compute the Ramanujan-Choi Approximation for the Median- Returns:
- The Ramanujan-Choi Approximation for the Median
-
chenRubinMedianLowerBound
public double chenRubinMedianLowerBound()Compute the Chen-Rubin Median Lower Bound- Returns:
- The Chen-Rubin Median Lower Bound
-
chenRubinMedianUpperBound
public double chenRubinMedianUpperBound()Compute the Chen-Rubin Median Upper Bound- Returns:
- The Chen-Rubin Median Upper Bound
-
scale
Generate a Scaled Gamma Distribution- Parameters:
scaleFactor
- The Gamma Distribution Scale Factor- Returns:
- Scaled Gamma Distribution
-
naturalParameters
public double[] naturalParameters()Retrieve the Array of Natural Parameters- Returns:
- Array of Natural Parameters
-
naturalStatistics
public double[] naturalStatistics(double x)Retrieve the Array of Natural Statistics- Parameters:
x
- X- Returns:
- Array of Natural Statistics
-
exponentialFamilyRepresentation
Generate the Exponential Family Representation- Parameters:
x
- X- Returns:
- Exponential Family Representation
-
laplacian
public double laplacian(double s) throws java.lang.ExceptionCompute the Laplacian- Parameters:
s
- S- Returns:
- The Laplacian
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
randomAhrensDieter1982
public double randomAhrensDieter1982() throws java.lang.ExceptionGenerate a Random Variable using the Ahrens-Dieter (1982) Scheme- Returns:
- Random Variable using the Ahrens-Dieter (1982) Scheme
- Throws:
java.lang.Exception
- Thrown if the Random Instance cannot be estimated
-
randomMarsaglia1977
public double randomMarsaglia1977() throws java.lang.ExceptionGenerate a Random Variable using the Marsaglia (1977) Scheme- Returns:
- Random Variable using the Marsaglia (1977) Scheme
- Throws:
java.lang.Exception
- Thrown if the Random Instance cannot be estimated
-