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 doublebannehekeEkayanakeMedianApproximation()Compute the Banneheke-Ekayanake Approximation for the Median when k gte 1doublechenRubinMedianLowerBound()Compute the Chen-Rubin Median Lower BounddoublechenRubinMedianUpperBound()Compute the Chen-Rubin Median Upper BoundR1UnivariateNormalcltProxy()Retrieve the Central Limit Theorem Equivalent Normal Distribution Proxydoublecumulative(double t)Compute the cumulative under the distribution to the given valuedoubledensity(double t)Compute the Density under the Distribution at the given VariatedoubledifferentialEntropy()Retrieve the Differential Entropy of the DistributionR1ToR1digammaEstimator()Retrieve the Digamma EstimatordoubleexcessKurtosis()Retrieve the Excess Kurtosis of the DistributionExponentialFamilyRepresentationexponentialFamilyRepresentation(double x)Generate the Exponential Family RepresentationR1ToR1gammaEstimator()Retrieve the Gamma Estimatordoublelaplacian(double s)Compute the LaplaciandoublelogarithmicExpectation()Compute the Logarithmic ExpectationR2ToR1lowerIncompleteGammaEstimator()Retrieve the Lower Incomplete Gamma Estimatordoublemean()Retrieve the Mean of the Distributiondoublemode()Retrieve the Mode of the DistributionR1ToR1momentGeneratingFunction()Construct the Moment Generating Functiondouble[]naturalParameters()Retrieve the Array of Natural Parametersdouble[]naturalStatistics(double x)Retrieve the Array of Natural StatisticsdoubleramanujanChoiMedianApproximation()Compute the Ramanujan-Choi Approximation for the MediandoublerandomAhrensDieter1982()Generate a Random Variable using the Ahrens-Dieter (1982) SchemedoublerandomMarsaglia1977()Generate a Random Variable using the Marsaglia (1977) SchemeR1ShapeScaleDistributionscale(double scaleFactor)Generate a Scaled Gamma Distributionstatic R1ShapeScaleDistributionShapeRate(double shapeParameter, double rateParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)Construct a Gamma Distribution from Shape and Rate ParametersShapeScaleParametersshapeScaleParameters()Retrieve the Shape-Scale Parametersstatic R1ShapeScaleDistributionShapeSummation(double[] shapeParameterArray, double scaleParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)Shape Summation Based ShapeScaleDistributiondoubleskewness()Retrieve the Skewness of the Distributionstatic R1ShapeScaleDistributionStandard(double shapeParameter, double scaleParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)Construct the Standard R1ShapeScaleDistribution Instancedouble[]support()Lay out the Support of the PDF Rangedoublevariance()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, tukeyCriterionMethods 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:R1UnivariateLay out the Support of the PDF Range- Specified by:
supportin classR1Univariate- Returns:
- Support of the PDF Range
-
density
public double density(double t) throws java.lang.ExceptionDescription copied from class:R1UnivariateCompute the Density under the Distribution at the given Variate- Specified by:
densityin 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:R1UnivariateCompute the cumulative under the distribution to the given value- Specified by:
cumulativein 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:R1UnivariateRetrieve the Mean of the Distribution- Specified by:
meanin 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:R1UnivariateRetrieve the Mode of the Distribution- Overrides:
modein 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:R1UnivariateRetrieve the Variance of the Distribution- Specified by:
variancein 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:R1UnivariateRetrieve the Skewness of the Distribution- Overrides:
skewnessin 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:R1UnivariateRetrieve the Excess Kurtosis of the Distribution- Overrides:
excessKurtosisin 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:R1UnivariateRetrieve the Differential Entropy of the Distribution- Overrides:
differentialEntropyin classR1Univariate- Returns:
- The Differential Entropy of the Distribution
- Throws:
java.lang.Exception- Thrown if the Entropy cannot be estimated
-
momentGeneratingFunction
Description copied from class:R1UnivariateConstruct the Moment Generating Function- Overrides:
momentGeneratingFunctionin 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
-