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


Author:
Lakshmi Krishnamurthy
  • Constructor Details

    • R1ShapeScaleDistribution

      public R1ShapeScaleDistribution​(ShapeScaleParameters shapeScaleParameters, R1ToR1 gammaEstimator, R1ToR1 digammaEstimator, R2ToR1 lowerIncompleteGammaEstimator) throws java.lang.Exception
      R1ShapeScaleDistribution Constructor
      Parameters:
      shapeScaleParameters - Shape-Scale Parameters
      gammaEstimator - Gamma Estimator
      digammaEstimator - Digamma Estimator
      lowerIncompleteGammaEstimator - 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 Parameter
      rateParameter - Rate Parameter
      gammaEstimator - Gamma Estimator
      digammaEstimator - Digamma Estimator
      lowerIncompleteGammaEstimator - 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 Array
      scaleParameter - Scale Parameter
      gammaEstimator - Gamma Estimator
      digammaEstimator - Digamma Estimator
      lowerIncompleteGammaEstimator - 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 Parameter
      scaleParameter - Scale Parameter
      gammaEstimator - Gamma Estimator
      digammaEstimator - Digamma Estimator
      lowerIncompleteGammaEstimator - Lower Incomplete Gamma Estimator
      Returns:
      The R1ShapeScaleDistribution Instance
    • shapeScaleParameters

      public ShapeScaleParameters shapeScaleParameters()
      Retrieve the Shape-Scale Parameters
      Returns:
      The Shape-Scale Parameters
    • gammaEstimator

      public R1ToR1 gammaEstimator()
      Retrieve the Gamma Estimator
      Returns:
      Gamma Estimator
    • digammaEstimator

      public R1ToR1 digammaEstimator()
      Retrieve the Digamma Estimator
      Returns:
      Digamma Estimator
    • lowerIncompleteGammaEstimator

      public R2ToR1 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 class R1Univariate
      Returns:
      Support of the PDF Range
    • density

      public double density​(double t) throws java.lang.Exception
      Description copied from class: R1Univariate
      Compute the Density under the Distribution at the given Variate
      Specified by:
      density in class R1Univariate
      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.Exception
      Description copied from class: R1Univariate
      Compute the cumulative under the distribution to the given value
      Specified by:
      cumulative in class R1Univariate
      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.Exception
      Description copied from class: R1Univariate
      Retrieve the Mean of the Distribution
      Specified by:
      mean in class R1Univariate
      Returns:
      The Mean of the Distribution
      Throws:
      java.lang.Exception - Thrown if the Mean cannot be estimated
    • mode

      public double mode() throws java.lang.Exception
      Description copied from class: R1Univariate
      Retrieve the Mode of the Distribution
      Overrides:
      mode in class R1Univariate
      Returns:
      The Mode of the Distribution
      Throws:
      java.lang.Exception - Thrown if the Mode cannot be estimated
    • variance

      public double variance() throws java.lang.Exception
      Description copied from class: R1Univariate
      Retrieve the Variance of the Distribution
      Specified by:
      variance in class R1Univariate
      Returns:
      The Variance of the Distribution
      Throws:
      java.lang.Exception - Thrown if the Variance cannot be estimated
    • skewness

      public double skewness() throws java.lang.Exception
      Description copied from class: R1Univariate
      Retrieve the Skewness of the Distribution
      Overrides:
      skewness in class R1Univariate
      Returns:
      The Skewness of the Distribution
      Throws:
      java.lang.Exception - Thrown if the Skewness cannot be estimated
    • excessKurtosis

      public double excessKurtosis() throws java.lang.Exception
      Description copied from class: R1Univariate
      Retrieve the Excess Kurtosis of the Distribution
      Overrides:
      excessKurtosis in class R1Univariate
      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.Exception
      Description copied from class: R1Univariate
      Retrieve the Differential Entropy of the Distribution
      Overrides:
      differentialEntropy in class R1Univariate
      Returns:
      The Differential Entropy of the Distribution
      Throws:
      java.lang.Exception - Thrown if the Entropy cannot be estimated
    • momentGeneratingFunction

      public R1ToR1 momentGeneratingFunction()
      Description copied from class: R1Univariate
      Construct the Moment Generating Function
      Overrides:
      momentGeneratingFunction in class R1Univariate
      Returns:
      The Moment Generating Function
    • cltProxy

      public R1UnivariateNormal 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.Exception
      Compute 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.Exception
      Compute 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

      public R1ShapeScaleDistribution scale​(double scaleFactor)
      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

      public ExponentialFamilyRepresentation exponentialFamilyRepresentation​(double x)
      Generate the Exponential Family Representation
      Parameters:
      x - X
      Returns:
      Exponential Family Representation
    • laplacian

      public double laplacian​(double s) throws java.lang.Exception
      Compute 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.Exception
      Generate 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.Exception
      Generate 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