Evaluate Arbitrary Negative Binomial Convolutions

Three distinct methods are implemented for evaluating the sums of arbitrary negative binomial distributions. These methods are: Furman's exact probability mass function (Furman (2007) ), saddlepoint approximation, and a method of moments approximation. Functions are provided to calculate the density function, the distribution function and the quantile function of the convolutions in question given said evaluation methods. Functions for generating random deviates from negative binomial convolutions and for directly calculating the mean, variance, skewness, and excess kurtosis of said convolutions are also provided.


nbconv

Introduction

nbconv was written to facilitate the evaluation of the sums of arbitrary negative binomial (NB) random variables. nbconv implements three distinct methods for approaching this problem: Furman's exact probability mass function (https://ssrn.com/abstract=1650365), saddlepoint approximation, and a method of moments approximation. I would like to acknowledge Martin ModrĂ¡k for inspiring me to pursue the saddlepoint approximation with his related blog post.

It should be noted that Furman's PMF is expressed as a series representation. Because of this, the accuracy of the evaluation is limited by the number of terms included in the series. The probability values calculated in this way are therefore also approximate solutions, meaning that nbconv only offers approximate solutions to the convolution of NB random variables. Nevertheless, the approximations appear to be rather good ones.

Like other distribution functions in R, nbconv can calculate the density, distribution, and quantile functions of NB convolutions. These are done with dnbconv(), pnbconv(), and qnbconv(), respectively. Each of these functions requires specification of the method of evaluation. Random deviates can be sampled with the rnbconv() function and are obtained independently of any evaluation method. Finally, the function nbconv_params() explicitly calculates the mean, variance, skewness, and excess kurtosis of the convolution distribution using cumulants.

See the manual for more information and please do not hesitate to reach out with any questions or comments.

Installation

You can install the development version of nbconv from GitHub with:

# install.packages("devtools")
devtools::install_github("gbedwell/nbconv")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("nbconv")

1.0.1 by Gregory Bedwell, 3 years ago


https://github.com/gbedwell/nbconv


Report a bug at https://github.com/gbedwell/nbconv/issues


Browse source code at https://github.com/cran/nbconv


Authors: Gregory Bedwell [aut, cre, cph]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports parallel, matrixStats, stats


See at CRAN