DPQ-package {DPQ}R Documentation

Density, Probability, Quantile ('DPQ') Computations

Description

Computations for approximations and alternatives for the 'DPQ' (Density (pdf), Probability (cdf) and Quantile) functions for probability distributions in R. Primary focus is on (central and non-central) beta, gamma and related distributions such as the chi-squared, F, and t. – This is for the use of researchers in these numerical approximation implementations, notably for my own use in order to improve R's own pbeta(), qgamma(), ..., etc: '"dpq"'-functions. – We plan to complement with 'DPQmpfr' to be suggested later.

Details

The DESCRIPTION file:

Package: DPQ
Title: Density, Probability, Quantile ('DPQ') Computations
Version: 0.4-2
Date: 2020-11-07
Authors@R: c(person("Martin","Maechler", role=c("aut","cre"), email="maechler@stat.math.ethz.ch", comment = c(ORCID = "0000-0002-8685-9910")) , person("Morten", "Welinder", role = "ctb", comment = "pgamma C code, see PR#7307, Jan. 2005; further pdhyper()") , person("Wolfgang", "Viechtbauer", role = "ctb", comment = "dtWV(), 2002") , person("Ross", "Ihaka", role = "ctb", comment = "src/qchisq_appr.c") , person("Marius", "Hofert", role = "ctb", comment = "lsum(), lssum()") , person("R-core", email = "R-core@R-project.org", role = "ctb", comment = "src/dpq.h, algdiv.c, pnchisq.c") , person("R Foundation", role = "cph", comment = "src/qchisq-appr.c") )
Description: Computations for approximations and alternatives for the 'DPQ' (Density (pdf), Probability (cdf) and Quantile) functions for probability distributions in R. Primary focus is on (central and non-central) beta, gamma and related distributions such as the chi-squared, F, and t. -- This is for the use of researchers in these numerical approximation implementations, notably for my own use in order to improve R`s own pbeta(), qgamma(), ..., etc: '"dpq"'-functions. -- We plan to complement with 'DPQmpfr' to be suggested later.
Depends: R (>= 3.6.0)
Imports: stats, graphics, methods, utils, sfsmisc
Suggests: Rmpfr, Matrix, MASS, mgcv, scatterplot3d, akima
SuggestsNote: Matrix only for its "test-tools-1.R"; mgcv,scatt..,akima: some tests/
License: GPL (>= 2)
Encoding: UTF-8
Author: Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Morten Welinder [ctb] (pgamma C code, see PR#7307, Jan. 2005; further pdhyper()), Wolfgang Viechtbauer [ctb] (dtWV(), 2002), Ross Ihaka [ctb] (src/qchisq_appr.c), Marius Hofert [ctb] (lsum(), lssum()), R-core [ctb] (src/dpq.h, algdiv.c, pnchisq.c), R Foundation [cph] (src/qchisq-appr.c)
Maintainer: Martin Maechler <maechler@stat.math.ethz.ch>
Repository: R-Forge
Repository/R-Forge/Project: specfun
Repository/R-Forge/Revision: 150
Repository/R-Forge/DateTimeStamp: 2020-11-07 09:47:38
Date/Publication: 2020-11-07 09:47:38

Index of help topics:

Bern                    Bernoulli Numbers
DPQ-package             Density, Probability, Quantile ('DPQ')
                        Computations
M_LN2                   Numerical Utilities - Functions, Constants
algdiv                  Compute log(gamma(b)/gamma(a+b)) when b >= 8
b_chi                   Compute E[chi_nu]/sqrt(nu) useful for t- and
                        chi-Distributions
bd0                     Utility Functions for 'dgamma()' - Pure R
                        Versions
dgamma.R                Gamma Density Function Alternatives
dhyperBinMolenaar       HyperGeometric (Point) Probabilities via
                        Molenaar's Binomial Approximation
dnchisqR                Approximations of the (Noncentral) Chi-Squared
                        Density
dntJKBf1                Non-central t-Distribution Density - Algorithms
                        and Approximations
dtWV                    Noncentral t Distribution Density by W.V.
format01prec            Format Numbers in [0,1] with "Precise" Result
hyper2binomP            Transform Hypergeometric Distribution
                        Parameters to Binomial Probability
lbetaM                  (Log) Beta Approximations
lfastchoose             R versions of Simple Formulas for Logarithmic
                        Binomial Coefficients
lgamma1p                Accurate 'log(gamma(a+1))'
lgammaAsymp             Asymptotic Log Gamma Function
log1mexp                Compute f(a) = log(1 - exp(-a)) Numerically
                        Optimally
log1pmx                 Accurate 'log(1+x) - x'
logcf                   Continued Fraction Approximation of Log-Related
                        Series
logspace.add            Logspace Arithmetix - Addition and Subtraction
lssum                   Compute Logarithm of a Sum with Signed Large
                        Summands
lsum                    Properly Compute the Logarithm of a Sum (of
                        Exponentials)
newton                  Simple R level Newton Algorithm, Mostly for
                        Didactical Reasons
pbetaRv1                Pure R Implementation of Old pbeta()
pchisqV                 Wienergerm Approximations to (Non-Central)
                        Chi-squared Probabilities
phyper1molenaar         Molenaar's Normal Approximations to the
                        Hypergeometric Distribution
phyperAllBin            Compute Hypergeometric Probabilities via
                        Binomial Approximations
phyperApprAS152         Normal Approximation to cumulative Hyperbolic
                        Distribution - AS 152
phyperBin.1             HyperGeometric Distribution via Approximate
                        Binomial Distribution
phyperBinMolenaar       HyperGeometric Distribution via Molenaar's
                        Binomial Approximation
phyperIbeta             Pearson's incomplete Beta Approximation to the
                        Hyperbolic Distribution
phyperPeizer            Peizer's Normal Approximation to the Cumulative
                        Hyperbolic
phyperR                 R-only version of R's original phyper()
                        algorithm
phyperR2                Pure R version of R's C level phyper()
phypers                 The Four (4) Symmetric phyper() calls.
pl2curves               Plot 2 Noncentral Distribution Curves for
                        Visual Comparison
pnbetaAppr2             Noncentral Beta Probabilities
pnchi1sq                (Probabilities of Non-Central Chi-squared
                        Distribution for Special Cases
pnchisq                 (Approximate) Probabilities of Non-Central
                        Chi-squared Distribution
pnormL_LD10             Bounds for 1-Phi(.) - Mill's Ratio related
                        Bounds for pnorm()
pntR                    Non-central t Probability Distribution -
                        Algorithms and Approximations
ppoisErr                Direct Computation of 'ppois()' Poisson
                        Distribution Probabilities
qbetaAppr               Compute (Approximate) Quantiles of the Beta
                        Distribution
qchisqAppr              Compute Approximate Quantiles of the
                        Chi-Squared Distribution
qgammaAppr              Compute (Approximate) Quantiles of the Gamma
                        Distribution
qnchisqAppr             Compute Approximate Quantiles of Noncentral
                        Chi-Squared Distribution
qnormAppr               Approximations to 'qnorm()', i.e., z_alpha
qnormR                  Pure R version of R's 'qnorm()' with
                        Diagnostics and Tuning Parameters
qtAppr                  Compute Approximate Quantiles of Non-Central t
                        Distribution
r_pois                  Compute Relative Size of i-th term of Poisson
                        Distribution Series

Further information is available in the following vignettes:

Noncentral-Chisq Noncentral Chi-Squared Probabilities -- Algorithms in R (source)
comp-beta Computing Beta(a,b) for Large Arguments (source)

An important goal is to investigate diverse algorithms and approximations of R's own density (d*()), probability (p*()), and quantile (q*()) functions, notably in “border” cases where the traditional published algorithms have shown to be suboptimal, not quite accurate, or even useless.

Examples are border cases of the beta distribution, or non-central distributions such as the non-central chi-squared and t-distributions.

Author(s)

Principal author and maintainer: Martin Maechler <maechler@stat.math.ethz.ch>

See Also

The package DPQmpfr (not yet on CRAN), which builds on this package and on Rmpfr.

Examples


## Show problem in R's non-central t-distrib. density (and approximations):
example(dntJKBf)



[Package DPQ version 0.4-2 Index]