Package org.drip.measure.gamma
Class R1ShapeScaleDistribution
java.lang.Object
org.drip.measure.continuous.R1Distribution
org.drip.measure.gamma.R1ShapeScaleDistribution
- Direct Known Subclasses:
ErlangDistribution,R1GammaToExponential,R1GammaToMaxwellBoltzmannSquared,R1ShapeScaleDiscrete
public class R1ShapeScaleDistribution extends R1Distribution
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
- Construct a Gamma Distribution from Shape and Rate Parameters
- Shape Summation Based R1ShapeScaleDistribution
- Construct the Standard R1ShapeScaleDistribution Instance
- R1ShapeScaleDistribution Constructor
- Retrieve the Shape-Scale Parameters
- Retrieve the Gamma Estimator
- Retrieve the Digamma Estimator
- Retrieve the Lower Incomplete Gamma Estimator
- Lay out the Support of the PDF Range
- Compute the Density under the Distribution at the given Variate
- Compute the cumulative under the distribution to the given value
- Retrieve the Mean of the Distribution
- Retrieve the Mode of the Distribution
- Retrieve the Variance of the Distribution
- Retrieve the Skewness of the Distribution
- Retrieve the Excess Kurtosis of the Distribution
- Retrieve the Differential Entropy of the Distribution
- Retrieve the Moment Generating Function of the Distribution
- Retrieve the Central Limit Theorem Equivalent Normal Distribution Proxy
- Compute the Logarithmic Expectation
- Compute the Banneheke-Ekayanake Approximation for the Median when k gte 1
- Compute the Ramanujan-Choi Approximation for the Median
- Compute the Chen-Rubin Median Lower Bound
- Compute the Chen-Rubin Median Upper Bound
- Generate a Scaled Gamma Distribution
- Retrieve the Array of Natural Parameters
- Retrieve the Array of Natural Statistics
- Generate the Exponential Family Representation
- Compute the Laplacian
- Generate a Random Variable using the Ahrens-Dieter (1982) Scheme
- Generate a Random Variable using the Marsaglia (1977) Scheme
| 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 Representationstatic R1ShapeScaleDistributionFromShapeAndRate(double shapeParameter, double rateParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)Construct a Gamma Distribution from Shape and Rate Parametersstatic R1ShapeScaleDistributionFromShapeAndSummation(double[] shapeParameterArray, double scaleParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)Shape Summation Based R1ShapeScaleDistributionR1ToR1gammaEstimator()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()Retrieve the Moment Generating Function of the Distributiondouble[]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 DistributionShapeScaleParametersshapeScaleParameters()Retrieve the Shape-Scale Parametersdoubleskewness()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.R1Distribution
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
-
FromShapeAndRate
public static final R1ShapeScaleDistribution FromShapeAndRate(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
-
FromShapeAndSummation
public static final R1ShapeScaleDistribution FromShapeAndSummation(double[] shapeParameterArray, double scaleParameter, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator)Shape Summation Based R1ShapeScaleDistribution- Parameters:
shapeParameterArray- Shape Parameter ArrayscaleParameter- Scale ParametergammaEstimator- Gamma EstimatordigammaEstimator- Digamma EstimatorlowerIncompleteGammaEstimator- Lower Incomplete Gamma Estimator- Returns:
- Shape Summation Based R1ShapeScaleDistribution
-
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()Lay out the Support of the PDF Range- Specified by:
supportin classR1Distribution- Returns:
- Support of the PDF Range
-
density
public double density(double t) throws java.lang.ExceptionCompute the Density under the Distribution at the given Variate- Specified by:
densityin classR1Distribution- 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.ExceptionCompute the cumulative under the distribution to the given value- Specified by:
cumulativein classR1Distribution- 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.ExceptionRetrieve the Mean of the Distribution- Specified by:
meanin classR1Distribution- Returns:
- The Mean of the Distribution
- Throws:
java.lang.Exception- Thrown if the Mean cannot be estimated
-
mode
public double mode() throws java.lang.ExceptionRetrieve the Mode of the Distribution- Overrides:
modein classR1Distribution- Returns:
- The Mode of the Distribution
- Throws:
java.lang.Exception- Thrown if the Mode cannot be estimated
-
variance
public double variance() throws java.lang.ExceptionRetrieve the Variance of the Distribution- Specified by:
variancein classR1Distribution- Returns:
- The Variance of the Distribution
- Throws:
java.lang.Exception- Thrown if the Variance cannot be estimated
-
skewness
public double skewness() throws java.lang.ExceptionRetrieve the Skewness of the Distribution- Overrides:
skewnessin classR1Distribution- Returns:
- The Skewness of the Distribution
- Throws:
java.lang.Exception- Thrown if the Skewness cannot be estimated
-
excessKurtosis
public double excessKurtosis() throws java.lang.ExceptionRetrieve the Excess Kurtosis of the Distribution- Overrides:
excessKurtosisin classR1Distribution- Returns:
- The Excess Kurtosis of the Distribution
- Throws:
java.lang.Exception- Thrown if the Excess Kurtosis cannot be estimated
-
differentialEntropy
public double differentialEntropy() throws java.lang.ExceptionRetrieve the Differential Entropy of the Distribution- Overrides:
differentialEntropyin classR1Distribution- Returns:
- The Differential Entropy of the Distribution
- Throws:
java.lang.Exception- Thrown if the Differential Entropy cannot be estimated
-
momentGeneratingFunction
Retrieve the Moment Generating Function of the Distribution- Overrides:
momentGeneratingFunctionin classR1Distribution- Returns:
- The Moment Generating Function of the Distribution
- Throws:
java.lang.Exception- Thrown if the Moment Generating Function cannot be estimated
-
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
-