UnequalProbabilityRandomSamplingFromBernoulliProbabilities Method |
Namespace: Novacta.Analytics
public static UnequalProbabilityRandomSampling FromBernoulliProbabilities( DoubleMatrix bernoulliProbabilities, int sampleSize )
Exception | Condition |
---|---|
ArgumentNullException | bernoulliProbabilities is null. |
ArgumentOutOfRangeException | bernoulliProbabilities has
Count equal to 1. -or- bernoulliProbabilities contains at least an entry not belonging to the open interval ]0, 1[. -or- sampleSize is not positive. |
ArgumentException | sampleSize is not less than the Count of bernoulliProbabilities. |
Method FromBernoulliProbabilities(DoubleMatrix, Int32) creates instances by assigning to each unit an independent Bernoulli random variable and sampling from the distribution of the sum of the corresponding Bernoulli trials conditional to having exactly SampleSize successes.