Class ExponentiallyModifiedGaussianDistribution

  • All Implemented Interfaces:
    Distribution

    @Alias("exgaussian")
    public class ExponentiallyModifiedGaussianDistribution
    extends java.lang.Object
    implements Distribution
    Exponentially modified Gaussian (EMG) distribution (ExGaussian distribution) is a combination of a normal distribution and an exponential distribution.

    Note that scipy uses a subtly different parameterization.

    TODO: implement quantile function!

    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double lambda
      Exponential rate.
      private double mean
      Mean value for the generator
      private double stddev
      Standard deviation
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated 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 lambda)
      Cumulative probability density function (CDF) of an exgauss distribution.
      double getLambda()  
      double getMean()  
      double getStddev()  
      double logpdf​(double val)
      Return the log density of an existing value
      static double logpdf​(double x, double mu, double sigma, double lambda)
      Probability density function of the ExGaussian 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 lambda)
      Probability density function of the ExGaussian distribution.
      double quantile​(double q)
      Deprecated.
      Not yet implemented!
      static double quantile​(double x, double mu, double sigma, double lambda)
      Deprecated.
      Not yet implemented!
      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

      • mean

        private double mean
        Mean value for the generator
      • stddev

        private double stddev
        Standard deviation
      • lambda

        private double lambda
        Exponential rate.
    • Constructor Detail

      • ExponentiallyModifiedGaussianDistribution

        public ExponentiallyModifiedGaussianDistribution​(double mean,
                                                         double stddev,
                                                         double lambda)
        Constructor for ExGaussian distribution
        Parameters:
        mean - Mean
        stddev - Standard Deviation
        lambda - Rate
    • Method Detail

      • 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

        @Deprecated
        public double quantile​(double q)
        Deprecated.
        Not yet implemented!
        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
      • getMean

        public double getMean()
        Returns:
        the mean
      • getStddev

        public double getStddev()
        Returns:
        the standard deviation
      • getLambda

        public double getLambda()
        Returns:
        the lambda value.
      • pdf

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

        public static double logpdf​(double x,
                                    double mu,
                                    double sigma,
                                    double lambda)
        Probability density function of the ExGaussian distribution.
        Parameters:
        x - The value.
        mu - The mean.
        sigma - The standard deviation.
        lambda - Rate parameter.
        Returns:
        PDF of the given exgauss distribution at x.
      • cdf

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

        @Deprecated
        public static double quantile​(double x,
                                      double mu,
                                      double sigma,
                                      double lambda)
        Deprecated.
        Not yet implemented!
        Inverse cumulative probability density function (probit) of an exgauss distribution.
        Parameters:
        x - value to evaluate probit function at.
        mu - Mean value.
        sigma - Standard deviation.
        lambda - Rate parameter.
        Returns:
        The probit of the given exgauss distribution at x.