Class Constant

    • Field Detail

      • ZERO

        public static final Constant ZERO
        A constant to represent zero for sharing
      • ONE

        public static final Constant ONE
        A constant to represent one for sharing
      • TWO

        public static final Constant TWO
        A constant to represent two for sharing
      • POSITIVE_INFINITY

        public static final Constant POSITIVE_INFINITY
        A constant to represent positive infinity for sharing
      • myValue

        protected double myValue
    • Constructor Detail

      • Constant

        public Constant​(double value)
        Construct a constant using the supplied value
        Parameters:
        value - the value for the constant
      • Constant

        public Constant​(double[] parameters)
        Parameters:
        parameters - the parameter[0] is the value
      • Constant

        public Constant​(double value,
                        java.lang.String name)
        Construct a constant using the supplied value
        Parameters:
        value - the value for the constant
        name - a string name/label
    • Method Detail

      • setParameters

        public void setParameters​(double[] parameters)
        Description copied from interface: ParametersIfc
        Sets the parameters
        Specified by:
        setParameters in interface ParametersIfc
        Parameters:
        parameters - an array of doubles representing the parameters
      • getParameters

        public final double[] getParameters()
        Description copied from interface: ParametersIfc
        Gets the parameters
        Specified by:
        getParameters in interface ParametersIfc
        Returns:
        Returns an array of the parameters
      • pmf

        public final double pmf​(double x)
        Description copied from interface: PMFIfc
        Returns the f(x) where f represents the probability mass function for the distribution.
        Specified by:
        pmf in interface PMFIfc
        Parameters:
        x - a double representing the value to be evaluated
        Returns:
        f(x) the P(X=x)
      • cdf

        public final double cdf​(double x)
        Description copied from interface: CDFIfc
        Returns the F(x) = Pr{X <= x} where F represents the cumulative distribution function
        Specified by:
        cdf in interface CDFIfc
        Parameters:
        x - a double representing the upper limit
        Returns:
        a double representing the probability
      • getMean

        public final double getMean()
        Description copied from interface: MeanIfc
        Returns the mean or expected value of a distribution
        Specified by:
        getMean in interface MeanIfc
        Returns:
        double the mean or expected value for the distribution
      • getVariance

        public final double getVariance()
        Description copied from interface: VarianceIfc
        Returns the variance of the distribution if defined
        Specified by:
        getVariance in interface VarianceIfc
        Returns:
        double the variance of the random variable
      • invCDF

        public final double invCDF​(double p)
        Description copied from interface: InverseCDFIfc
        Provides the inverse cumulative distribution function for the distribution While closed form solutions for the inverse cdf may not exist, numerical search methods can be used to solve F(X) = U.
        Specified by:
        invCDF in interface InverseCDFIfc
        Parameters:
        p - The probability to be evaluated for the inverse, p must be [0,1] or an IllegalArgumentException is thrown
        Returns:
        The inverse cdf evaluated at the supplied probability