Class CauchyDistribution

  • All Implemented Interfaces:
    Distribution

    public class CauchyDistribution
    extends java.lang.Object
    implements Distribution
    Cauchy distribution.
    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) double location
      The location (x0) parameter.
      (package private) double shape
      The shape (gamma) parameter.
    • Constructor Summary

      Constructors 
      Constructor Description
      CauchyDistribution​(double location, double shape)
      Constructor with default random.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double cdf​(double x)
      Return the cumulative density function at the given value.
      static double cdf​(double x, double location, double shape)
      PDF function, static version.
      double getLocation()
      Get the location parameter.
      double getShape()
      Return the shape parameter.
      double logpdf​(double x)
      Return the log density of an existing value
      static double logpdf​(double x, double location, double shape)
      PDF function, static version.
      double nextRandom​(java.util.Random random)
      Generate a new random value
      double pdf​(double x)
      Return the density of an existing value
      static double pdf​(double x, double location, double shape)
      PDF function, static version.
      double quantile​(double x)
      Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.
      static double quantile​(double x, double location, double shape)
      PDF function, static version.
      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

      • location

        final double location
        The location (x0) parameter.
      • shape

        final double shape
        The shape (gamma) parameter.
    • Constructor Detail

      • CauchyDistribution

        public CauchyDistribution​(double location,
                                  double shape)
        Constructor with default random.
        Parameters:
        location - Location (x0)
        shape - Shape (gamma)
    • Method Detail

      • getLocation

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

        public double getShape()
        Return the shape parameter.
        Returns:
        Shape
      • pdf

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

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

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

        public double quantile​(double x)
        Description copied from interface: Distribution
        Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.
        Specified by:
        quantile in interface Distribution
        Parameters:
        x - 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
      • pdf

        public static double pdf​(double x,
                                 double location,
                                 double shape)
        PDF function, static version.
        Parameters:
        x - Value
        location - Location (x0)
        shape - Shape (gamma)
        Returns:
        PDF value
      • logpdf

        public static double logpdf​(double x,
                                    double location,
                                    double shape)
        PDF function, static version.
        Parameters:
        x - Value
        location - Location (x0)
        shape - Shape (gamma)
        Returns:
        PDF value
      • cdf

        public static double cdf​(double x,
                                 double location,
                                 double shape)
        PDF function, static version.
        Parameters:
        x - Value
        location - Location (x0)
        shape - Shape (gamma)
        Returns:
        PDF value
      • quantile

        public static double quantile​(double x,
                                      double location,
                                      double shape)
        PDF function, static version.
        Parameters:
        x - Value
        location - Location (x0)
        shape - Shape (gamma)
        Returns:
        PDF 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