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

Class BinomialDistribution

  • All Implemented Interfaces:
    Distribution


    public final class BinomialDistribution
    extends java.lang.Object
    implements Distribution
    A binomial distribution, with parameters N and P
    • Constructor Detail

      • BinomialDistribution

        public BinomialDistribution()
        Default builder. Creates a binomial distribution with parameters N=1, P=0.0
      • BinomialDistribution

        public BinomialDistribution(int n,
                                    double p)
        Builder. Creates a binomial distribution with parameters N and P
        Parameters:
        n - N parameter
        p - P parameter
      • BinomialDistribution

        public BinomialDistribution(BinomialDistribution old)
        Copy constructor Creates a copy of a given binomial distribution
        Parameters:
        old - Binomial 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
      • setN

        public void setN(int value)
        Sets the N parameter. Only works if N is greater than 0
        Parameters:
        value - N parameter value
      • getN

        public int getN()
        Gets the N parameter value
        Returns:
        value of N
      • computeProbability

        public double computeProbability(double value)
        Computes mass probability at a given point of the binomial 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 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'
      • getLesserCumulativeProbability

        public int getLesserCumulativeProbability(double limit)
        Computes the greatest integer whose cumulative probability is lower than a given value
        Parameters:
        limit - Maximum probability allowed
        Returns:
        greatest integer found. -1 if there is not any.
      • getUpperCumulativeProbability

        public int getUpperCumulativeProbability(double limit)
        Computes the lowest integer whose cumulative probability is greater than a given value
        Parameters:
        limit - Minimum probability allowed
        Returns:
        lowest integer found. -1 if there is not any.
      • 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.