Calculates expected values of the upper parts of negative binomial distributions (R.W. Payne).
Options
BOUND = variate or scalar |
Boundary of upper part of distribution |
Parameters
MEANS = variates or scalar |
Means of the distributions |
AGGREGATION = scalars |
Aggregation parameter for the distributions |
EXPECTEDVALUES = variates or scalar |
Saves the expected values |
CUPROBABILITIES = variates or scalar |
Saves the cumulative upper probabilities |
Description
EUNEGBINOMIAL calculates expected values of the upper parts of negative binomial distributions. The calculation is for all values greater than or equal to the value specified, in either a scalar or a variate, by the BOUND option. The MEANS parameter specifies a variate containing means of the distributions, or it can be set to a scalar if there is a single distribution. If BOUND and SCALE are variates, they must both be the same length. The AGGREGATION parameter specifies a scalar containing their aggregation parameter. The expected values can be saved in either a variate or a scalar (to match the type of MEANS) by the EXPECTEDVALUES parameter. The corresponding cumulative upper probabilities can similarly be saved by the CUPROBABILITIES parameter.
Options: BOUND.
Parameters: MEANS, AGGREGATION , EXPECTEDVALUES, PROBABILITIES
Method
The expected value for each mean is given by the sum, for n running from BOUND to nmax, of
n * PRNEGATIVEBINOMIAL(n;mean) / CUNEGATIVEBINOMIAL(BOUND-1;mean)
The upper limit nmax is taken as the highest value for which the negative binomial probability is greater than or equal to 1.0 E−14.
Problems arise when the cumulative upper probability becomes very low. The calculation becomes unreliable, due to numerical round-off, for values less than 1.0 E−10. A missing value is then returned for the expected value, and a zero value for the cumulative upper probability.
See also
Directives: DISTRIBUTION
Procedures: ELGAMMA ELNEGBINOMIAL ELPOISSON EUPOISSON RNBTOBIT
GenStat Reference Manual 1 Summary section on: Basic and nonparametric statistics.
Example
CAPTION 'EUNEGBINOMIAL example',!t('Expected values for means 101-120',\
'with a lower bound of 100, and aggregation parameter 5.');\
STYLE=meta,plain
VARIATE [VALUES=101...120] Means
EUNEGBINOMIAL [BOUND=100] Means; AGGREGATION=5; EXPECTEDVALUES=Expected;\
CUPROBABILITIES=Cupr
PRINT Means,Expected,Cupr; DECIMALS=0,3,4