Class SkewGeneralizedNormalDistribution

  • All Implemented Interfaces:
    Distribution

    @Reference(authors="J. R. M. Hosking, J. R. Wallis",
               title="Regional frequency analysis: an approach based on L-moments",
               booktitle="Regional frequency analysis: an approach based on L-moments",
               url="https://doi.org/10.1017/CBO9780511529443",
               bibkey="doi:10.1017/CBO9780511529443")
    public class SkewGeneralizedNormalDistribution
    extends java.lang.Object
    implements Distribution
    Generalized normal distribution by adding a skew term, similar to lognormal distributions.

    This is one kind of generalized normal distributions. Note that there are multiple that go by the name of a "Generalized Normal Distribution"; this is what is currently called "version 2" in English Wikipedia.

    Reference:

    J. R. M. Hosking, J. R. Wallis
    Regional frequency analysis: an approach based on L-moments

    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double loc
      Location.
      private double scale
      Scale.
      private double skew
      Skew.
    • Constructor Summary

      Constructors 
      Constructor Description
      SkewGeneralizedNormalDistribution​(double loc, double scale, double skew)
      Constructor for Gaussian distribution
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double cdf​(double val)
      Return the cumulative density function at the given value.
      static double cdf​(double x, double mu, double sigma, double skew)
      Cumulative probability density function (CDF) of a normal distribution.
      double getLocation()
      Get the location parameter
      double getScale()
      Get the scale parameter
      double getSkew()
      Get the skew parameter.
      double logpdf​(double val)
      Return the log density of an existing value
      static double logpdf​(double x, double mu, double sigma, double skew)
      Probability density function of the skewed normal distribution.
      double nextRandom​(java.util.Random random)
      Generate a new random value
      double pdf​(double val)
      Return the density of an existing value
      static double pdf​(double x, double mu, double sigma, double skew)
      Probability density function of the skewed normal distribution.
      double quantile​(double q)
      Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.
      static double quantile​(double x, double mu, double sigma, double skew)
      Inverse cumulative probability density function (probit) of a normal distribution.
      java.lang.String toString()
      Describe the distribution
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • loc

        private double loc
        Location.
      • scale

        private double scale
        Scale.
      • skew

        private double skew
        Skew.
    • Constructor Detail

      • SkewGeneralizedNormalDistribution

        public SkewGeneralizedNormalDistribution​(double loc,
                                                 double scale,
                                                 double skew)
        Constructor for Gaussian distribution
        Parameters:
        loc - Location
        scale - Scale
        skew - Skew
    • Method Detail

      • getLocation

        public double getLocation()
        Get the location parameter
        Returns:
        Location
      • getScale

        public double getScale()
        Get the scale parameter
        Returns:
        Scale
      • getSkew

        public double getSkew()
        Get the skew parameter.
        Returns:
        Skew parameter
      • pdf

        public double pdf​(double val)
        Description copied from interface: Distribution
        Return the density of an existing value
        Specified by:
        pdf in interface Distribution
        Parameters:
        val - existing value
        Returns:
        distribution density
      • logpdf

        public double logpdf​(double val)
        Description copied from interface: Distribution
        Return the log density of an existing value
        Specified by:
        logpdf in interface Distribution
        Parameters:
        val - existing value
        Returns:
        log distribution density
      • cdf

        public double cdf​(double val)
        Description copied from interface: Distribution
        Return the cumulative density function at the given value.
        Specified by:
        cdf in interface Distribution
        Parameters:
        val - existing value
        Returns:
        cumulative density
      • quantile

        public double quantile​(double q)
        Description copied from interface: Distribution
        Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.
        Specified by:
        quantile in interface Distribution
        Parameters:
        q - Quantile to find
        Returns:
        Quantile position
      • nextRandom

        public double nextRandom​(java.util.Random random)
        Description copied from interface: Distribution
        Generate a new random value
        Specified by:
        nextRandom in interface Distribution
        Parameters:
        random - Random number generator
        Returns:
        new random value
      • toString

        public java.lang.String toString()
        Description copied from interface: Distribution
        Describe the distribution
        Specified by:
        toString in interface Distribution
        Overrides:
        toString in class java.lang.Object
        Returns:
        description
      • pdf

        public static double pdf​(double x,
                                 double mu,
                                 double sigma,
                                 double skew)
        Probability density function of the skewed normal distribution.
        Parameters:
        x - The value.
        mu - The mean.
        sigma - The standard deviation.
        Returns:
        PDF of the given normal distribution at x.
      • logpdf

        public static double logpdf​(double x,
                                    double mu,
                                    double sigma,
                                    double skew)
        Probability density function of the skewed normal distribution.
        Parameters:
        x - The value.
        mu - The mean.
        sigma - The standard deviation.
        Returns:
        log PDF of the given normal distribution at x.
      • cdf

        public static double cdf​(double x,
                                 double mu,
                                 double sigma,
                                 double skew)
        Cumulative probability density function (CDF) of a normal distribution.
        Parameters:
        x - value to evaluate CDF at
        mu - Mean value
        sigma - Standard deviation.
        Returns:
        The CDF of the given normal distribution at x.
      • quantile

        public static double quantile​(double x,
                                      double mu,
                                      double sigma,
                                      double skew)
        Inverse cumulative probability density function (probit) of a normal distribution.
        Parameters:
        x - value to evaluate probit function at
        mu - Mean value
        sigma - Standard deviation.
        Returns:
        The probit of the given normal distribution at x.