# negativeBinomial (truncated)

Distribution negativeBinomial(p, n) is stretched by stretch coefficient, then shifted to the right by shift, after that it is truncated to fit in [min, max] interval. Truncation is performed by discarding every sample outside this interval and taking subsequent try.

For more details see negativeBinomial().

negativeBinomial(double min, double max, double p, double n, double shift, double stretch)

#### Description

Generates a sample of the truncated Negative Binomial distribution.

#### Parameters

 Name Type Description min double The minimum value that this function will return. The distribution is truncated to return values above this. If the sample (stretched and shifted) is below this value, it will be discarded and another sample will be drawn. Use -infinity for "No limit". max double The maximum value that this function will return. The distribution is truncated to return values below this. If the sample (stretched and shifted) is bigger than this value, it will be discarded and another sample will be drawn. Use infinity for "No limit". p double The probability of the event occurrence. n double The number of trials. If n is not an integer it will be rounded to the nearest integer. shift double The shift parameter that indicates how much the (stretched) distribution will be shifted to the right. stretch double The stretch parameter that indicates how much the distribution will be stretched.

#### Result

 Type Description double The generated sample.

negativeBinomial(double min, double max, double p, double n, java.util.Random r)

#### Description

Generates a sample of the truncated Negative Binomial distribution using the specified random number generator.

#### Parameters

 Name Type Description min double The minimum x value. max double The maximum x value. p double The probability of the event occurrence. n double The number of trials. If n is not an integer it will be rounded to the nearest integer. shift double The shift parameter. stretch double The stretch parameter r java.util.Random the random number generator

#### Result

 Type Description double The generated sample.

This document includes content from the Stat::Fit User's Manual. Copyright � 2016 Geer Mountain Software Corp.