Package: DPQ 0.5-9-1

Martin Maechler

DPQ: Density, Probability, Quantile ('DPQ') Computations

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. -- For several distribution functions, provide functions implementing formulas from Johnson, Kotz, and Kemp (1992) <doi:10.1002/bimj.4710360207> and Johnson, Kotz, and Balakrishnan (1995) for discrete or continuous distributions respectively. This is for the use of researchers in these numerical approximation implementations, notably for my own use in order to improve standard R pbeta(), qgamma(), ..., etc: {'"dpq"'-functions}.

Authors:Martin Maechler [aut, cre], Morten Welinder [ctb], Wolfgang Viechtbauer [ctb], Ross Ihaka [ctb], Marius Hofert [ctb], R-core [ctb], R Foundation [cph]

DPQ_0.5-9-1.tar.gz
DPQ_0.5-9-1.zip(r-4.5)DPQ_0.5-9-1.zip(r-4.4)DPQ_0.5-9-1.zip(r-4.3)
DPQ_0.5-9-1.tgz(r-4.4-x86_64)DPQ_0.5-9-1.tgz(r-4.4-arm64)DPQ_0.5-9-1.tgz(r-4.3-x86_64)DPQ_0.5-9-1.tgz(r-4.3-arm64)
DPQ_0.5-9-1.tar.gz(r-4.5-noble)DPQ_0.5-9-1.tar.gz(r-4.4-noble)
DPQ_0.5-9-1.tgz(r-4.4-emscripten)DPQ_0.5-9-1.tgz(r-4.3-emscripten)
DPQ.pdf |DPQ.html
DPQ/json (API)
NEWS

# Install 'DPQ' in R:
install.packages('DPQ', repos = c('https://r-forge.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://r-forge.r-project.org/projects/specfun

Datasets:

On CRAN:

fortran

5.99 score 1 packages 43 scripts 502 downloads 252 exports 1 dependencies

Last updated 2 months agofrom:c953b5aa5a. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKDec 02 2024
R-4.5-win-x86_64OKDec 02 2024
R-4.5-linux-x86_64OKDec 02 2024
R-4.4-win-x86_64OKDec 02 2024
R-4.4-mac-x86_64OKDec 02 2024
R-4.4-mac-aarch64OKDec 02 2024
R-4.3-win-x86_64OKDec 02 2024
R-4.3-mac-x86_64OKDec 02 2024
R-4.3-mac-aarch64OKDec 02 2024

Exports:.D_0.D_1.D_Clog.D_Cval.D_exp.D_LExp.D_log.D_Lval.D_qIv.D_val.dntJKBch.dntJKBch1.DT_0.DT_1.DT_Cexp.DT_CIv.DT_Clog.DT_Cval.DT_exp.DT_log.DT_Log.DT_qIv.DT_val.p1l1ser.pow.qgammaApprBnd.suppHyperalgdivall_mpfrany_mpfrb_chib_chiAsympbd0bd0_l1pmbd0_p1l1dbd0_p1l1d1bd0CBernbetaIbpserc_dtc_dtAsympc_ptchebyshev_ncchebyshevEvalchebyshevPolydbinom_rawdchisqAsymdgamma.RdhyperBinMolenaardnbinom.mudnbinomRdnchisqBesseldnchisqRdnoncentchisqdntJKBfdntJKBf1dpois_rawdpois_simpldpois_simpl0dpsifndtWVebd0ebd0Cexpm1xexpm1xTserf05lchooseformat01precfrexpG_halfg2gam1dgamln1gammaVergnthh0h1h2hnthyper2binomPIxpqlb_chi0lb_chi00lb_chiAsymplbeta_asylbetaIlbetaMlbetaMMldexplfastchooselgamma1plgamma1p_serieslgamma1p.lgamma1pClgammaAsymplgammacorlog1mexplog1mexpClog1pexpClog1pmxlog1pmxClogcflogcfRlogcfR.logQab_asylogrlogspace.addlogspace.sublssumlsumM_cutoffM_LN2M_minExpM_SQRT2modfnewtonokLongDoublep1l1p1l1.p1l1pp1l1serpbetaRv1pchisqVpchisqWpchisqW.pchisqW.Rpdhyperphyper1molenaarphyper2molenaarphyperAllBinphyperAllBinMphyperApprAS152phyperBin.1phyperBin.2phyperBin.3phyperBin.4phyperBinMolenaarphyperBinMolenaar.1phyperBinMolenaar.2phyperBinMolenaar.3phyperBinMolenaar.4phyperIbetaphyperPeizerphyperRphyperR2phyperspl2curvesplRpoispnbetaAppr2pnbetaAppr2v1pnbetaAS310pnchi1sqpnchi3sqpnchisqpnchisq_sspnchisqAbdelAtypnchisqBolKuzpnchisqITpnchisqPatnaikpnchisqPearsonpnchisqRCpnchisqSankaran_dpnchisqT93pnchisqT93.apnchisqT93.bpnchisqTermspnchisqVpnormAsymppnormL_LD10pnormU_S53pnt3150pnt3150.1pntChShP94pntChShP94.1pntGST23_1pntGST23_T6pntGST23_T6.1pntJW39pntJW39.0pntLrgpntP94pntP94.1pntRpntR1pntVW13powpow_dipow1pppoisDppoisErrQab_termsqbeta.RqbetaApprqbetaAppr.1qbetaAppr.2qbetaAppr.3qbetaAppr.4qbinomRqchisqApprqchisqAppr.0qchisqAppr.1qchisqAppr.2qchisqAppr.3qchisqAppr.RqchisqApprCF1qchisqApprCF2qchisqCappr.2qchisqKGqchisqNqchisqWHqgamma.RqgammaApprqgammaApprKGqgammaApprSmallPqnbinomRqnchisqAbdelAtyqnchisqBolKuzqnchisqPatnaikqnchisqPearsonqnchisqSankaran_dqnormApprqnormAsympqnormCapprqnormRqnormR1qnormUapprqnormUappr6qntRqntR1qpoisRqsqtApprqtNapprqtRqtR1qtUqtU1r_poisr_pois_exprrexpm1rlog1ssss2ss2.stirlerrstirlerr_simplstirlerrCsWz.fz.sz0

Dependencies:sfsmisc

Asymptotic Tail Formulas For Gaussian Quantiles

Rendered fromqnorm-asymp.Rnwusingutils::Sweaveon Dec 02 2024.

Last update: 2023-01-24
Started: 2022-11-28

Computing Beta(a,b) for Large Arguments

Rendered fromcomp-beta.Rnwusingutils::Sweaveon Dec 02 2024.

Last update: 2019-08-31
Started: 2019-08-15

log1pmx, bd0, stirlerr - Probability Computations in R

Rendered fromlog1pmx-etc.Rnwusingutils::Sweaveon Dec 02 2024.

Last update: 2024-03-21
Started: 2021-04-30

Noncentral Chi-Squared Probabilities -- Algorithms in R

Rendered fromNoncentral-Chisq.Rnwusingutils::Sweaveon Dec 02 2024.

Last update: 2021-05-07
Started: 2019-09-02

Readme and manuals

Help Manual

Help pageTopics
Density, Probability, Quantile ('DPQ') ComputationsDPQ-package DPQ
Compute log(gamma(b)/gamma(a+b)) when b >= 8algdiv
Compute E[chi_nu]/sqrt(nu) useful for t- and chi-Distributionsb_chi b_chiAsymp c_dt c_dtAsymp c_pt lb_chi0 lb_chi00 lb_chiAsymp
Bernoulli NumbersBern
'pbeta()' 'bpser' series computationbpser
Chebyshev Polynomial EvaluationchebyshevEval chebyshevPoly chebyshev_nc
R's C Mathlib (Rmath) dbinom_raw() Binomial Probability pure R Functiondbinom_raw
Approximations of the (Noncentral) Chi-Squared DensitydchisqAsym dnchisqBessel dnchisqR dnoncentchisq
Binomial Deviance - Auxiliary Functions for 'dgamma()' Etcbd0 bd0C bd0_l1pm bd0_p1l1d bd0_p1l1d1 dpois_raw dpois_simpl dpois_simpl0 ebd0 ebd0C
Gamma Density Function Alternativesdgamma.R
HyperGeometric (Point) Probabilities via Molenaar's Binomial ApproximationdhyperBinMolenaar
Pure R Versions of R's C (Mathlib) dnbinom() Negative Binomial Probabilitiesdnbinom.mu dnbinomR
Non-central t-Distribution Density - Algorithms and Approximations.dntJKBch .dntJKBch1 dntJKBf dntJKBf1
Distribution Utilities "dpq".DT_0 .DT_1 .DT_Cexp .DT_CIv .DT_Clog .DT_Cval .DT_exp .DT_Log .DT_log .DT_qIv .DT_val .D_0 .D_1 .D_Clog .D_Cval .D_exp .D_LExp .D_log .D_Lval .D_qIv .D_val
Psi Gamma Functions Workhorse from R's APIdpsifn
Asymptotic Noncentral t Distribution Density by ViechtbauerdtWV
Accurate exp(x) - 1 - x (for smallish |x|)expm1x expm1xTser
Format Numbers in [0,1] with "Precise" Resultformat01prec
Base-2 Representation and Multiplication of Numbersfrexp ldexp
Compute 1/Gamma(x+1) - 1 Accuratelygam1d
Compute log( Gamma(x+1) ) Accurately in [-0.2, 1.25]gamln1
Gamma Function VersionsgammaVer
Transform Hypergeometric Distribution Parameters to Binomial Probabilityhyper2binomP
Normalized Incomplete Beta Function "Like" 'pbeta()'Ixpq
(Log) Beta and Ratio of Gammas ApproximationsbetaI lbetaI lbetaM lbetaMM lbeta_asy logQab_asy Qab_terms
R versions of Simple Formulas for Logarithmic Binomial Coefficientsf05lchoose lfastchoose
Accurate 'log(gamma(a+1))'lgamma1p lgamma1p. lgamma1pC lgamma1p_series
Asymptotic Log Gamma FunctionlgammaAsymp
Compute log(1 - exp(-a)) and log(1 + exp(x)) Numerically Optimallylog1mexp log1mexpC log1pexpC
Accurate 'log(1+x) - x' Computationlog1pmx log1pmxC rlog1
Continued Fraction Approximation of Log-Related Power Serieslogcf logcfR logcfR.
Logspace Arithmetix - Addition and Subtractionlogspace.add logspace.sub
Compute Logarithm of a Sum with Signed Large Summandslssum
Properly Compute the Logarithm of a Sum (of Exponentials)lsum
Simple R level Newton Algorithm, Mostly for Didactical Reasonsnewton
Numerical Utilities - Functions, Constantsall_mpfr any_mpfr G_half logr modf M_cutoff M_LN2 M_minExp M_SQRT2 okLongDouble
Numerically Stable p1l1(t) = (t+1)*log(1+t) - t.p1l1ser p1l1 p1l1. p1l1p p1l1ser
Pure R Implementation of Old pbeta()pbetaRv1
Compute Hypergeometric Probabilities via Binomial Approximations.suppHyper phyperAllBin phyperAllBinM
Normal Approximation to cumulative Hyperbolic Distribution - AS 152phyperApprAS152
HyperGeometric Distribution via Approximate Binomial DistributionphyperBin.1 phyperBin.2 phyperBin.3 phyperBin.4
HyperGeometric Distribution via Molenaar's Binomial ApproximationphyperBinMolenaar phyperBinMolenaar.1 phyperBinMolenaar.2 phyperBinMolenaar.3 phyperBinMolenaar.4
Pearson's incomplete Beta Approximation to the Hyperbolic DistributionphyperIbeta
Molenaar's Normal Approximations to the Hypergeometric Distributionphyper1molenaar phyper2molenaar
Peizer's Normal Approximation to the Cumulative HyperbolicphyperPeizer
R-only version of R's original phyper() algorithmphyperR
Pure R version of R's C level phyper()pdhyper phyperR2
The Four (4) Symmetric 'phyper()' Callsphypers
Plot 2 Noncentral Distribution Curves for Visual Comparisonpl2curves
Noncentral Beta ProbabilitiespnbetaAppr2 pnbetaAppr2v1 pnbetaAS310
(Probabilities of Non-Central Chi-squared Distribution for Special Casespnchi1sq pnchi3sq
(Approximate) Probabilities of Non-Central Chi-squared Distributionpnchisq pnchisqAbdelAty pnchisqBolKuz pnchisqIT pnchisqPatnaik pnchisqPearson pnchisqRC pnchisqSankaran_d pnchisqT93 pnchisqT93.a pnchisqT93.b pnchisqTerms pnchisqV pnchisq_ss ss ss2 ss2.
Wienergerm Approximations to (Non-Central) Chi-squared Probabilitiesg2 gnt h h0 h1 h2 hnt pchisqV pchisqW pchisqW. pchisqW.R qs scalefactor sW z.f z.s z0
Asymptotic Approxmation of (Extreme Tail) 'pnorm()'pnormAsymp
Bounds for 1-Phi(.) - Mill's Ratio related Bounds for pnorm()pnormL_LD10 pnormU_S53
Non-central t Probability Distribution - Algorithms and Approximationspnt3150 pnt3150.1 pntChShP94 pntChShP94.1 pntGST23_1 pntGST23_T6 pntGST23_T6.1 pntJW39 pntJW39.0 pntLrg pntP94 pntP94.1 pntR pntR1 pntVW13
X to Power of Y - R C API 'R_pow()'.pow pow pow_di
Accurate (1+x)^y, notably for small |x|pow1p
Direct Computation of 'ppois()' Poisson Distribution ProbabilitiesppoisD ppoisErr
Viktor Witosky's Table_1 pt() Examplespt_Witkovsky_Tab1
Compute (Approximate) Quantiles of the Beta Distributionqbeta.R qbetaAppr qbetaAppr.1 qbetaAppr.2 qbetaAppr.3 qbetaAppr.4
Pure R Implementation of R's qbinom() with Tuning ParametersqbinomR
Compute Approximate Quantiles of the Chi-Squared DistributionqchisqAppr qchisqAppr.R qchisqKG qchisqWH
Compute (Approximate) Quantiles of the Gamma Distribution.qgammaApprBnd qgamma.R qgammaAppr qgammaApprKG qgammaApprSmallP
Pure R Implementation of R's qnbinom() with Tuning ParametersqnbinomR
Compute Approximate Quantiles of Noncentral Chi-Squared DistributionqchisqAppr.0 qchisqAppr.1 qchisqAppr.2 qchisqAppr.3 qchisqApprCF1 qchisqApprCF2 qchisqCappr.2 qchisqN qnchisqAbdelAty qnchisqAppr qnchisqBolKuz qnchisqPatnaik qnchisqPearson qnchisqSankaran_d
Approximations to 'qnorm()', i.e., z_alphaqnormAppr qnormCappr qnormUappr qnormUappr6
Asymptotic Approximation to Outer Tail of qnorm()qnormAsymp
Pure R version of R's 'qnorm()' with Diagnostics and Tuning ParametersqnormR qnormR1
Pure R Implementation of R's qt() / qnt()qntR qntR1
Pure R Implementation of R's qpois() with Tuning ParametersqpoisR
Compute Approximate Quantiles of the (Non-Central) t-DistributionqtAppr qtNappr
Pure R Implementation of R's C-level t-Distribution Quantiles 'qt()'qtR qtR1
'uniroot()'-based Computing of t-Distribution QuantilesqtU qtU1
Compute Relative Size of i-th term of Poisson Distribution SeriesplRpois r_pois r_pois_expr
TOMS 708 Approximation REXP(x) of expm1(x) = exp(x) - 1rexpm1
Stirling's Error Function - Auxiliary for Gamma, Beta, etclgammacor stirlerr stirlerrC stirlerr_simpl