Click or drag to resize

UnequalProbabilityRandomSamplingFromBernoulliProbabilities Method

Initializes a new instance of the UnequalProbabilityRandomSampling class by specifying the Bernoulli probabilities assigned to the population units and the sample size.

Namespace:  Novacta.Analytics
Assembly:  Novacta.Analytics (in Novacta.Analytics.dll) Version: 2.0.0
Syntax
public static UnequalProbabilityRandomSampling FromBernoulliProbabilities(
	DoubleMatrix bernoulliProbabilities,
	int sampleSize
)

Parameters

bernoulliProbabilities
Type: Novacta.AnalyticsDoubleMatrix
The Bernoulli probabilities assigned to the population units.
sampleSize
Type: SystemInt32
The size of the samples to draw.

Return Value

Type: UnequalProbabilityRandomSampling
The UnequalProbabilityRandomSampling instance having the specified characteristics.
Exceptions
ExceptionCondition
ArgumentNullExceptionbernoulliProbabilities is null.
ArgumentOutOfRangeExceptionbernoulliProbabilities 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.
ArgumentExceptionsampleSize is not less than the Count of bernoulliProbabilities.
Remarks

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.

See Also