Class DiscreteUniformPD

java.lang.Object
com.imsl.stat.distributions.ProbabilityDistribution
com.imsl.stat.distributions.DiscreteUniformPD
All Implemented Interfaces:
ClosedFormMaximumLikelihoodInterface, PDFGradientInterface, PDFHessianInterface, Serializable, Cloneable

The discrete uniform probability distribution.
See Also:
  • Constructor Details

    • DiscreteUniformPD

      public DiscreteUniformPD()
      Constructor for the discrete uniform probability distribution.
  • Method Details

    • getParameterLowerBounds

      public double[] getParameterLowerBounds()
      Returns the lower bound of the parameter.
      Specified by:
      getParameterLowerBounds in class ProbabilityDistribution
      Returns:
      a double array of length 1 containing the lower bound (1)
    • getParameterUpperBounds

      public double[] getParameterUpperBounds()
      Returns the upper bound of the parameter.
      Specified by:
      getParameterUpperBounds in class ProbabilityDistribution
      Returns:
      a double array of length 1 containing the upper bound
    • pdf

      public double pdf(double x, double... params)
      Evaluates the discrete uniform probability density function.

      The discrete uniform probability distribution with scale parameter \(n\) is defined as $$f(x;n) = \frac{1}{n}, \quad x=1,\ldots n$$

      Specified by:
      pdf in class ProbabilityDistribution
      Parameters:
      x - a double, the value (quantile) at which to evaluate the pdf. x should be a positive integer between the lower limit 1 and upper limit n. If x is not a whole number, it is type cast to an integer.
      params - a double, the upper limit n of the discrete uniform distribution. params should be a positive integer. If params is not a whole number, the type cast to integer is used instead.
      Returns:
      a double, the probability that a discrete uniform random variable takes a value equal to x
    • getPDFGradient

      public double[] getPDFGradient(double x, double... params)
      Returns the analytic gradient of the pdf evaluated at x.
      Specified by:
      getPDFGradient in interface PDFGradientInterface
      Parameters:
      x - a double value. x must be a positive integer. If x is not a whole number, the type cast to integer is used instead.
      params - a positive double specifying the upper limit of the discrete uniform distribution. params should be positive integer. If params is not a whole number, the type cast to integer is used instead.
      Returns:
      a double array containing the first partial derivative of the parameter
    • getPDFHessian

      public double[][] getPDFHessian(double x, double... params)
      Returns the analytic Hessian matrix evaluated at x.
      Specified by:
      getPDFHessian in interface PDFHessianInterface
      Parameters:
      x - a double value. x must be a positive integer. If x is not a whole number, the type cast to integer is used instead.
      params - a double specifying the upper limit of the discrete uniform distribution. params should be positive.
      Returns:
      a double matrix containing the second derivative of the parameter
    • getClosedFormMLE

      public double[] getClosedFormMLE(double[] x)
      Returns the maximum likelihood estimate for the parameter.
      Specified by:
      getClosedFormMLE in interface ClosedFormMaximumLikelihoodInterface
      Parameters:
      x - a double array containing the data
      Returns:
      a double array containing the maximum likelihood estimate for the upper limit of the discrete uniform distribution
    • getClosedFormMlStandardError

      public double[] getClosedFormMlStandardError(double[] x)
      Returns the standard error of the maximum likelihood estimate.
      Specified by:
      getClosedFormMlStandardError in interface ClosedFormMaximumLikelihoodInterface
      Parameters:
      x - a double array containing the data
      Returns:
      a double array containing the standard error