Skip to content

Delaporte

9.0.0Package record

Statistical Functions for the Delaporte Distribution

1packages depend
8.8Kdownloads / year
100.0%test coverage
13/13flavors OK

Overview

About

Provides probability mass, distribution, quantile, random-variate generation, and method-of-moments parameter-estimation functions for the Delaporte distribution with parameterization based on Vose (2008) <isbn:9780470512845>. The Delaporte is a discrete probability distribution which can be considered the convolution of a negative binomial distribution with a Poisson distribution. Alternatively, it can be considered a counting distribution with both Poisson and negative binomial components. It has been studied in actuarial science as a frequency distribution which has more variability than the Poisson, but less than the negative binomial.

Changes in 9.0.0

While there are breaking changes below, the majority of them would not have been encountered in normal practice. Most users should see no change to results, other than increased speed and fewer failures.

Fixed

  • **Breaking:** Internal function log1p now carries a cubic Taylor term. The prior quadratic form left a truncation error of order beta^3 / 3. For large with very small this reached the sixth significant figure of ordinary probabilities. Results for beta > 1e-4 are bitwise-unchanged.
  • **Breaking:** Non-finite parameters now return NaN with a warning across d/p/q/rdelap instead of clamp-laundered 0s and 1s.
  • **Breaking:** ddelap, pdelap, qdelap, and rdelap with singleton parameters now first attempt to build their PMF and CDF tables using a three-term recurrence relationship derived from the Delaporte distribution's probability generating function. This takes O(K) arithmetic operations instead of O(K^2) log_gamma/exp evaluations. Masses whose leading term underflows---roughly + (1+) > 745---are handled by internal rescaling, allowing accuracy to be retained for very large . This is done natively in linear- or log-space as per the call. This may shift results relative to the old "always sum" algorithm at the level of accumulated rounding: one or two ulps for short tables, growing with table length to roughly the 13th significant digit for very long ones. Both parameters extreme enough to risk overflow in the recurrence fall back to the summation algorithm and vector-valued parameters continue to use the per-element path.
  • **Breaking:** ddelap and pdelap now treat arguments below the support the same way base R does. ddelap returns 0 (-Inf with log = TRUE) and pdelap returns a lower-tail CDF of 0 and a survival of 1. Previously these inputs returned NaN with a "NaNs produced" warning.
  • **Breaking:** ddelap's internal summand formula subtracted from its running sum before a large canceling pair, lgamma(alpha+i) - lgamma(alpha) (exactly 0 at i = 0), had resolved. When is very small, lgamma(alpha) is itself large, and , when smaller than that intermediate value's rounding unit, was silently discarded before the cancellation completed. This was invisible with log = FALSE, since exp() of the resulting error and exp(0) = 1 are both indistinguishable in linear-space double precision at the affected magnitudes. Parenthesizing the canceling pair so it resolves first fixes both the log-space and linear-space summand formulas. Ordinary (non-degenerate) parameters are bitwise-unchanged.
  • **Breaking:** ddelap with log = TRUE now accumulates the PMF in log space using a streaming log-sum-exp instead of taking the log of the linear-space result. This is technically breaking as deep-tail log-probabilities which previously returned -Inf because the linear PMF underflowed below the smallest representable double are now accurate to near full precision. For example, ddelap(2000, 1, 1, 1, log = TRUE) returns approximately -1385.99 instead of -Inf. Hoisting the variables for both log and normal space routines makes them slightly faster than before.
  • **Breaking:** pdelap with lower.tail = FALSE now computes the upper tail by direct summation of the PMF when doing so is needed to preserve accuracy, instead of 1 - CDF. Survival probabilities near or below machine epsilon previously returned only floating-point rounding noise. For example, pdelap(60, 1, 1, 1, lower.tail = FALSE) returned roughly 3.3e-16 when the true value is roughly 1.18e-18. The algorithms are now accurate to near full double precision. This is technically breaking, but users should see no change outside of the deep tail which was likely not of interest to most. This summation is used only once the survival probability is small enough that the ordinary complement 1 - CDF would lose meaningful precision: below sqrt(EPS) ~ 1.49e-8. Since the summation's remainder-bound safeguard gives it an O(beta^2) worst-case cost, it is reserved for where it is genuinely needed.
  • **Breaking:** pdelap with log.p = TRUE previously computed the linear-space CDF/survival first and took log() of the result, so any value that underflowed to exactly 0 in the deep tail silently returned -Inf even though the true log-probability is finite. log.p = TRUE is now computed directly in log space throughout, matching the log-space guarantee ddelap(..., log = TRUE) already provides, and is accurate to near full double precision even where the linear-space value underflows. pdelap derives log-probabilities in the saturated bands---log-CDF values within about sqrt(.Machine$double.eps) of 0, and their log-survival mirror---from the opposite, relatively accurate side via log1p(-exp(.)) rather than reporting the accumulation's own rounding noise. On the log scale those values now agree with an independent dnbinom* dpois convolution oracle to about 1e-13 relative. In linear space, the original algorithm was already accurate to an ulp, so linear-scale results are unaffected, as is everything outside the bands. All three computational routes---recurrence table, degenerate-ratio elemental fill, and vector-parameter recycling---apply the same repair. A consequence is that qdelap/pdelap round trips with log.p = TRUE are now exact in both tails wherever the input is representable.
  • **Breaking:** qdelap for probabilities within accumulated rounding of 1 combined with highly overdispersed parameters previously ground its lookup-table build indefinitely, as the cumulative sum plateaus below such targets no matter how far it extends. These targets are now resolved from the accurate upper-tail survival table, returning the true finite quantile instantly. For example, qdelap(1 - 1e-12, 5, 5, 7000) now returns 7630. Ordinary probabilities are unaffected.
  • **Breaking:** qdelap with lower.tail = FALSE and/or log.p = TRUE now searches in the native space of the supplied probabilities instead of transforming them to linear lower-tail space first. The old 1 - p flip collapsed survival probabilities below machine epsilon to exactly 1, returning Inf where qpois resolves a finite quantile, and the old exp() of log-probabilities collapsed deep log-space targets the same way; near-1 targets were inflated by an ulp, stepping round-tripped quantiles up by one. Upper-tail targets are now searched against a survival table built as pdelap, and log-space targets against log-probability tables accumulated by streaming log-sum-exp. The default (lower.tail = TRUE, log.p = FALSE) path is bitwise-unchanged. Interior search targets carry one-sided tolerances sized to their measured noise sources, in the spirit of base R's 64 * EPS fuzz in qpois.c. The vector-parameter path retains base R's fuzz verbatim.
Show all changes in 9.0.0Hide the rest of the changes in 9.0.0
  • **Breaking:** qdelap no longer hangs when passed extreme parameter sets whose quantiles are computationally unreachable. The original explicit-summation algorithm, now used when the recurrence table would overflow, costs O(answer^2). Past 2^15 summation steps qdelap now returns NaN for the unresolved targets with the warning "quantile too large to compute exactly for these parameter values; NaN returned", as a truncated cumulative sum carries no information about a quantile beyond it. The parameter sets involved generally put the true quantile beyond 2^53, where a count is no longer exactly representable as a double in any case. Targets the partial sum *did* resolve, including the p = 0 and p = 1 boundaries, still return normally.
  • **Breaking:** The approximate form of qdelap, which has much less utility now (see documentation), will always generate at least 10,000 variates for pooling. It remains capped at no more than 10M variates. Prior behavior for pathologically tiny means (~1e-12) could have resulted in no variants being generated and an NA return.
  • **Breaking:** The approximate form of qdelap now pre-allocates the result vector at full length first and then assigns the NaN, Inf, 0, or proper value for each category. This ensures that element i of the output always corresponds to element i of the input. Previously, the return may have scrambled the "valid" inputs if there were non-valid values in the input.
  • For x 2^{63}, including +Inf, the functions no longer convert x to an integer kind which it then overflows. Instead, they return 0 or -Inf directly.
  • Zero-length parameters now return zero-length results in p/d/qdelap per base R. This is not considered breaking as it used to fail with a segfault from Fortran.
  • Zero-length parameters in rdelap now return NaNs per base R. This is not considered breaking as it used to fail with a segfault from Fortran.
  • qdelap and rdelap with a NaN scalar parameter previously looped indefinitely while consuming memory. Now they return NaN with a warning, matching pdelap.
  • Prevented qdelap from overwriting passed p vector within Fortran, preserving the .Call contract.

Changed

  • **Breaking:** Both the exact and approximate versions of qdelap now return NaN with a warning for probabilities strictly greater than one, following base R convention. The function returns Inf only for probabilities exactly equal to one. Prior behavior was that all probabilities 1 returned Inf.
  • **Breaking:** setDelapThreads no longer calls omp_set_num_threads, and getDelapThreads no longer calls omp_get_max_threads. The thread count is package-local and is passed to each parallelized routine, whose num_threads clauses already scope it per region. Process-global OpenMP state is never modified, so Delaporte neither affects nor is affected by the threading of other OpenMP-using packages. On load, the count is seeded from the OpenMP runtime default, which respects OMP_NUM_THREADS and OMP_THREAD_LIMIT.
  • As the singleton-parameter CDF build is no longer quadratic, the maximum q for pdelap's fast path was raised from 2^{14} to 2^{24}, and the interactive confirmation prompt now guards only the genuinely slow routes: vector-valued parameters with q at or above 2^{15}, or any q at or above 2^{24}. When not interactive, pdelap checks the new (and undocumented) Delaporte.maxq option in the local environment and stops if the largest value exceeds the option or warns if it does not. The default value is 2^{15}.
  • Changing qdelap to use the lookup table most of the time exact = TRUE makes it orders of magnitude faster than exact = FALSE for essentially all practical parameter ranges. The only time where exact = FALSE may still be worth considering is when the expected table length, K = + + 10(1+) + , exceeds roughly 1.5e7. Beyond that point, the exact path's memory use of ~17 bytes per unit of K begins to exceed the bounded ~330MB/2.5s cost of the Monte Carlo approximation. The table size K depends on the distribution's dispersion, not just its mean. A low mean with a high overdispersion can require as large a table as a much larger, near-Poisson mean. The exact = FALSE remains unavailable for vector-valued parameters regardless of this threshold, as approximate quantiles cannot be pooled across distinct parameter triplets.
  • qdelap and rdelap with singleton parameters now size their quantile lookup table from a moment-based estimate and grow it geometrically, replacing element-by-element growth whose copying was O(K^2). The table is built with the identical routine and accumulation order as pdelap, so the qdelap(pdelap(k)) == k round trip is preserved bitwise. They now also locate quantiles in the sorted CDF vector by a binary search instead of a linear scan.
  • MoMdelap now checks that at least 3 values are passed to it, none of which are NA, otherwise it will error. This is not considered breaking as it used to fail with a different error which propagated from Fortran (missing value where TRUE/FALSE needed). Now it never triggers a Fortran call.
  • Cleaned Makevars from unneeded calls to BLAS and LAPACK libraries.
  • The guidance added to Writing R Extensions in r88406 is better adhered to by storing the package-specific state (the thread count and detected CPU count) in an environment inside the *package* namespace. The environment is no longer created in the user's workspace, and is no longer exported.
  • Refactored C and Fortran sources to be more manageable using header files, splitting initialization from active function calls, hardening with explicit "only" lists on the Fortran side, removing unnecessary includes, and using the modern bind(C) interface to call back-and-forth between C and Fortran instead of the older F77 idiom.
  • The manual now documents the package's accuracy limits at the representation edges: the context dependence of lower.tail = FALSE values at the level of their accumulated rounding, the +/-1 round-trip shoulder for survival targets within about sqrt(.Machine$double.eps) of 1, the linear-space convention (and consequent deep-tail saturation) of vector-parameter qdelap, and the cost profile of deep upper-tail log-scale quantiles at high dispersion.
  • Updated unit tests and documentation for the changes and fixed a number of spelling and grammar mistakes.

Removed

  • **Breaking:** The sOMPT_C function and entry point was removed, including its R_RegisterCCallable registration, as were the .onDetach thread reset and its Fortran backend sOMPT_f.
  • **Breaking:** DelaporteEnv is no longer exported.

From inst/NEWS.Rd in the release

Install

Health

CRAN checks
13OK
Slowest check: 2.4 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 9.0.0
READMEYes · 174 wordsVignettesNoNEWSYes · mentions 9.0.0Citation fileYes · computed when R runs itWebsitenot declared in DESCRIPTION
Help pages
5 (1 internal)includes a package overview page
Examples that run
100%2 run in a plain check
Exported functions with examples
100%
Documented parameters
92%
Return-value docs
100%
Help pages citing references
20%

Downloads

8.8K
CRAN downloads in the past year
Rank #4,051 · ~24/day · ~733/mo
Daily download trend is not available in this view yet.
93030 days
2.2K90 days
8.8K1 year
Compare downloads with other packages →
Also on447 r2u10 autocran7.9K conda_forge242 bioconda124 c2d4u

Repository

4Stars
1Forks
0Open issues
0Open PRs
10Releases
646Commits
3Commit identities
646 commits · Last activity 2026-08-23
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
5
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2023-08-25 · 32026-07-07 · 4
PracticesBeta

8 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/aadler/delaporte on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (3)
Code of conductContributing guideSecurity policy
Coverage (1)
Coverage reporting
Research and citation (1)
CITATION.cff
Show all practicesHide 1 practice
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
2 external dependencies (excludes base and recommended)

Installing Delaporte adds no packages beyond those that come with R.

Depends (1)
R >= 3.6.0
Imports (2)
statsparallel
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Imports 1
Depends, Imports or LinkingTo, most downloaded first

People & History

People (1)
Author, Copyright holder, Maintainer since 0.1-1 (2013)
Releases (42)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 9.0.0Latest
    record
    2026-01-09 · current release · diff ↗ ·
    removed 1 export
    DelaporteEnv
  • 8.4.3
    record
    2026-01-09 · diff ↗
  • 8.4.2
    record
    2025-07-17 · diff ↗ ·
    added 1 export
    DelaporteEnv
  • R
    R 4.5.0 released · 2025-04-11
  • 8.4.1
    record
    2024-06-17 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • 8.4.0
    record
    2024-04-04 · diff ↗
  • 8.3.0
    record
    2023-10-02 · diff ↗
  • 8.2.0
    record
    2023-08-10 · diff ↗ ·
    removed 1 export
    pattern:^[[:alpha:]]+
    added 7 exports
    ddelap, pdelap, qdelap, rdelap, MoMdelap, getDelapThreads, setDelapThreads
  • 8.1.1
    record
    2023-06-20 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 8.1.0
    record
    2023-02-01 · diff ↗
  • 8.0.3
    record
    2022-09-06 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 8.0.2
    record
    2022-01-20 · diff ↗
Show 40 earlier eventsHide 40 earlier events

Package metadata

First published
2013-04-09
Total releases
42 / 13 yrs
License
BSD_2_clause + file LICENSE OSI · relicensed from GPL (>= 2) | LGPL (>= 3) in 4.0.0
Minimum R
≥ 3.6.0
Download size
79 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("Delaporte")

The package provides a citation file that builds its entry when R runs it. Run citation() to see it.

The repository also keeps a CITATION.cff.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for Delaporte version 9.0.0 [Data set]. HJJB, LLC. Data release v2026-10-17. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy