Documentation of 'javanpst.distributions.common.discrete.GeometricDistribution' Java class
GeometricDistribution
javanpst.distributions.common.discrete

Class GeometricDistribution

  • All Implemented Interfaces:
    Distribution


    public final class GeometricDistribution
    extends java.lang.Object
    implements Distribution
    A geometric distribution, with parameter P
    • Constructor Detail

      • GeometricDistribution

        public GeometricDistribution()
        Default builder. Creates a geometric distribution with parameter P=0.0
      • GeometricDistribution

        public GeometricDistribution(double p)
        Builder. Creates a geometric distribution with parameter P
        Parameters:
        p - P parameter
      • GeometricDistribution

        public GeometricDistribution(GeometricDistribution old)
        Copy constructor Creates a copy of a given geometric distribution
        Parameters:
        old - geometric distribution to copy
    • Method Detail

      • setP

        public void setP(double value)
        Sets the P parameter. Only works if P is in [0.0,1.0]
        Parameters:
        value - P parameter value
      • getP

        public double getP()
        Gets the P parameter value
        Returns:
        value of P
      • computeProbability

        public double computeProbability(double value)
        Computes mass probability at a given point of the geometric distribution. Value given is converted to integer before computing probability.
        Specified by:
        computeProbability in interface Distribution
        Parameters:
        value - point selected
        Returns:
        mass probability at 'value'
      • computeCumulativeProbability

        public double computeCumulativeProbability(double value)
        Computes cumulative probability at a given point of the geometric distribution. Value given is converted to integer before computing probability.
        Specified by:
        computeCumulativeProbability in interface Distribution
        Parameters:
        value - point selected
        Returns:
        cumulative probability at 'value'
      • toString

        public java.lang.String toString()
        To String method.
        Overrides:
        toString in class java.lang.Object
        Returns:
        string representation of the distribution

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.