statmod: Probability Calculations for the Inverse Gaussian Distribution

Abstract:

The inverse Gaussian distribution (IGD) is a well known and often used probability dis tribution for which fully reliable numerical algorithms have not been available. We develop fast, reliable basic probability functions (dinvgauss, pinvgauss, qinvgauss and rinvgauss) for the IGD that work for all possible parameter values and which achieve close to full machine accuracy. The most challenging task is to compute quantiles for given cumulative probabilities and we develop a simple but elegant mathematical solution to this problem. We show that Newton’s method for finding the quantiles of a IGD always converges monotonically when started from the mode of the distribution. Simple Taylor series expansions are used to improve accuracy on the log-scale. The IGD probability functions provide the same options and obey the same conventions as do probability functions provided in the stats package.

Cite PDF Tweet

Authors

Affiliations

Göknur Giner

 

Gordon K. Smyth

 

Published

July 26, 2016

Received

Jan 5, 2016

DOI

10.32614/RJ-2016-024

Volume

Pages

8/1

339 - 351

CRAN packages used

SuppDists, STAR, statmod

CRAN Task Views implied by cited packages

Distributions, HighPerformanceComputing, NumericalMathematics

Footnotes

    Reuse

    Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

    Citation

    For attribution, please cite this work as

    Giner & Smyth, "The R Journal: statmod: Probability Calculations for the Inverse Gaussian Distribution", The R Journal, 2016

    BibTeX citation

    @article{RJ-2016-024,
      author = {Giner, Göknur and Smyth, Gordon K.},
      title = {The R Journal: statmod: Probability Calculations for the Inverse Gaussian Distribution},
      journal = {The R Journal},
      year = {2016},
      note = {https://doi.org/10.32614/RJ-2016-024},
      doi = {10.32614/RJ-2016-024},
      volume = {8},
      issue = {1},
      issn = {2073-4859},
      pages = {339-351}
    }