Binomial Distribution Constructor
Definition
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Overload List
Binomial | Constructs a new BinomialDistribution with the specified number of trials. The probability of success is set to 0.5. |
Binomial | Estimates the parameters of the distribution of a variable assuming it follows a binomial distribution. |
Binomial | Estimates the parameters of the distribution of a variable assuming it follows a binomial distribution. |
Binomial | Constructs a new BinomialDistribution with the specified number of trials and probability of success. |
BinomialDistribution(Int32)
public BinomialDistribution(
int numberOfTrials
)
Parameters
- numberOfTrials Int32
- The number of trials.
Remarks
The number of trials must be greater than or equal to 0. The probability of success is taken to be 0.5.
The resulting distribution is that of the number of heads or tails in a series of numberOfTrials coin tosses.
Exceptions
ArgumentOutOfRangeException | numberOfTrials is less than zero. |
BinomialDistribution(Vector<Double>)
public BinomialDistribution(
Vector<double> variable
)
Parameters
- variable Vector<Double>
- A vector.
Return Value
The BinomialDistribution that best matches the distribution of variable.Remarks
Use this constructor to create a BinomialDistribution whose parameter is estimated from variable.
Exceptions
ArgumentNullException | variable is null. |
ArgumentException | The mean of variable is less than zero. Samples from a binomial distribution cannot be negative. |
BinomialDistribution(Int32, Vector<Double>)
public BinomialDistribution(
int numberOfTrials,
Vector<double> variable
)
Parameters
- numberOfTrials Int32
- The number of trials.
- variable Vector<Double>
- A vector.
Return Value
The BinomialDistribution that best matches the distribution of variable.Remarks
Use this constructor to create a BinomialDistribution whose parameter is estimated from variable.
Exceptions
ArgumentNullException | variable is null. |
ArgumentOutOfRangeException | numberOfTrials is less than zero. |
ArgumentException | The mean of variable is less than zero. Samples from a binomial distribution cannot be negative. |
BinomialDistribution(Int32, Double)
public BinomialDistribution(
int numberOfTrials,
double probabilityOfSuccess
)
Parameters
- numberOfTrials Int32
- The number of trials.
- probabilityOfSuccess Double
- The probability of a trial resulting in success.
Remarks
The number of trials must be greater than or equal to 0. The probability of success must be between 0 and 1.
Exceptions
ArgumentOutOfRangeException | numberOfTrials is less than or equal to zero.
-or- probabilityOfSuccess is less than zero or greater than 1. |