Package: nhppp 1.1.1.9000

Thomas Trikalinos

nhppp: Simulating Nonhomogeneous Poisson Point Processes

Simulates events from one dimensional nonhomogeneous Poisson point processes (NHPPPs) as per Trikalinos and Sereda (2024, <doi:10.48550/arXiv.2402.00358> and 2024, <doi:10.1371/journal.pone.0311311>). Functions are based on three algorithms that provably sample from a target NHPPP: the time-transformation of a homogeneous Poisson process (of intensity one) via the inverse of the integrated intensity function (Cinlar E, "Theory of stochastic processes" (1975, ISBN:0486497996)); the generation of a Poisson number of order statistics from a fixed density function; and the thinning of a majorizing NHPPP via an acceptance-rejection scheme (Lewis PAW, Shedler, GS (1979) <doi:10.1002/nav.3800260304>).

Authors:Thomas Trikalinos [aut, cre, cph], Yuliia Sereda [aut]

nhppp_1.1.1.9000.tar.gz
nhppp_1.1.1.9000.zip(r-4.7-x86_64)nhppp_1.1.1.9000.zip(r-4.7-arm64)nhppp_1.1.1.9000.zip(r-4.6-x86_64)nhppp_1.1.1.9000.zip(r-4.6-arm64)nhppp_1.1.1.9000.zip(r-4.5-x86_64)
nhppp_1.1.1.9000.tgz(r-4.6-x86_64)nhppp_1.1.1.9000.tgz(r-4.6-arm64)nhppp_1.1.1.9000.tgz(r-4.5-x86_64)nhppp_1.1.1.9000.tgz(r-4.5-arm64)
nhppp_1.1.1.9000.tar.gz(r-4.7-arm64)nhppp_1.1.1.9000.tar.gz(r-4.7-x86_64)nhppp_1.1.1.9000.tar.gz(r-4.6-arm64)nhppp_1.1.1.9000.tar.gz(r-4.6-x86_64)
nhppp_1.1.1.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
nhppp/json (API)

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

Bug tracker:https://github.com/bladder-ca/nhppp/issues

Pkgdown/docs site:https://bladder-ca.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

cpp

6.40 score 4 stars 45 scripts 492 downloads 28 exports 4 dependencies

Last updated from:f74f3aae08. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK134
linux-devel-x86_64OK178
source / vignettesOK301
linux-release-arm64OK160
linux-release-x86_64OK201
macos-release-arm64OK120
macos-release-x86_64OK349
macos-oldrel-arm64OK149
macos-oldrel-x86_64OK272
windows-devel-arm64OK248
windows-devel-x86_64OK170
windows-release-arm64OK247
windows-release-x86_64OK146
windows-oldrel-x86_64OK156
wasm-releaseOK122

Exports:drawdraw_cumulative_intensitydraw_intensitydraw_sc_lineardraw_sc_loglineardraw_sc_stepdraw_sc_step_regularget_step_majorizerinverse_with_unirootinverse_with_uniroot_sortedpppppp_exactly_nppp_next_nrbtpoisrztpoissimpson_num_integrvdrawvdraw_cumulative_intensityvdraw_intensityvdraw_intensity_stepvdraw_sc_stepvdraw_sc_step_regularvdraw_sc_step_regular_cppvztdraw_sc_stepztdraw_cumulative_intensityztdraw_sc_linearztdraw_sc_loglinearztppp

Dependencies:clilifecycleRcpprlang

Sampling log-linear times
Simulation description | Overview of sampling methods described here | Setup | Intensity, cumulative intensity, and inverse cumulative intensity functions | Intensity function $\lambda()$ | Cumulative intensity function $\Lambda(t)$ | Inverse cumulative intensity function $\Lambda^{-1}(z)$ | Method 1: non-vectorized sampling with nhppp::draw_sc_loglinear() | Method 2: Vectorized sampling using only $\lambda()$ | Method 3: Vectorized sampling using $\Lambda()$ and $\Lambda^{-1}()$ | Comparisons | Simulation time-costs | Simulated times | Acknowledgments | Bibliography

Last update: 2026-11-15
Started: 2024-10-17

A simple discrete event simulation model of a cancer's natural history
The simulation world | Setup | Simulation model | Death from other causes | Environmental toxin exposure histories | Emergence of pre-clinical cancer in unexposed and exposed intervals | Dying from cancer | Dying from all causes | Clinical cancer diagnosis | Some descriptives | Bibliography

Last update: 2026-11-15
Started: 2024-10-23

How to write an intensity or cumulative intensity function for vectorized models
What this vignette shows | The calling contract | Passing parameters: the structured container | Cumulative intensity pairs | Majorizers from the same function | A complete example: heterogeneous population, both algorithms | Anti-patterns

Last update: 2026-11-15
Started: 2026-11-15

Long event output for large simulations
What this vignette shows | The two formats | The two outputs describe the same realization | Memory | Speed | The conditioned samplers work the same way | Which format to use

Last update: 2026-11-15
Started: 2026-11-15

Sampling from Gompertz processes
Simulation description | Setup | The Gompertz Process functions | Vectorized specification of the Gompertz $\lambda()$, $\Lambda()$, and $\Lambda^{-1}()$ | Method 1: Vectorized sampling using only $\lambda()$ | Method 2: Vectorized sampling using $\Lambda()$ and $\Lambda^{-1}()$ | Comparisons | Simulation time-costs | Simulated times | Simulating all event trajectories | Demonstrating that we simulate from the correct intensity function | Acknowledgments | Bibliography

Last update: 2026-11-15
Started: 2025-08-20

Sampling from Weibull processes
Simulation description | Setup | The Weibull Process functions | Vectorized specification of the Weibull $\lambda()$, $\Lambda()$, and $\Lambda^{-1}()$ | Method 1: Vectorized sampling using only $\lambda()$ | Method 2: Vectorized sampling using $\Lambda()$ and $\Lambda^{-1}()$ | Comparisons | Simulation time-costs | Simulated times | Demonstrating that we simulate from the correct intensity function | Acknowledgments | Bibliography

Last update: 2026-11-15
Started: 2025-08-20

Step intensities over arbitrary intervals
What this vignette shows | Simulation description | Sampling with shared interval bounds | The sampled times follow the target intensity | Per-process interval bounds | Subintervals and first events | Zero-truncated sampling | Timing study | Bibliography

Last update: 2026-11-15
Started: 2026-11-15

Readme and manuals

Help Manual

Help pageTopics
Generic function for simulating from NHPPPs given the intensity function or the cumulative intensity function.draw
Simulate from a non homogeneous Poisson Point Process (NHPPP) over an interval when you know the cumulative intensity and its inverse.draw_cumulative_intensity
Generic function for simulating from NHPPPs given the intensity function.draw_intensity
Special case: Simulate from a non homogeneous Poisson Point Process (NHPPP) from (t_min, t_max) with linear intensity function (inversion method)draw_sc_linear
Special case: Simulate from a non homogeneous Poisson Point Process (NHPPP) from (t_min, t_max) with log-linear intensity function (inversion method)draw_sc_loglinear
Simulate a piecewise constant-rate Poisson Point Process over (t_min, t_max] (inversion method) The intervals need not have the same length.draw_sc_step
Sampling from NHPPPs with piecewise constant intensities with same interval lengths (non-vectorized)draw_sc_step_regular
Piecewise constant (step) majorizer for K-Lipschitz functions over an interval (vectorized over the 'breaks' argument).get_step_majorizer
Simulate a homogeneous Poisson Point Process in (t_min, t_max]ppp
Simulate exactly 'n' points from a homogeneous Poisson Point Process over (t_min, t_max]ppp_exactly_n
Simulate n events from a homogeneous Poisson Point Process.ppp_next_n
Vectorized generic function for simulating from NHPPPs given the intensity function or the cumulative intensity functionvdraw
Vectorized simulation from a non homogeneous Poisson Point Process (NHPPP) from (t_min, t_max) given the cumulative intensity function and its inversevdraw_cumulative_intensity
Vectorized sampling from a non homogeneous Poisson Point Process (NHPPP) from an interval (thinning method) with piecewise constant_majorizers (C++)vdraw_intensity
Vectorized sampling from NHPPPs given the intensity function, with piecewise constant majorizers over arbitrary interval bounds (C++)vdraw_intensity_step
Vectorized sampling from NHPPPs with piecewise constant intensities over arbitrary interval bounds (C++)vdraw_sc_step
Vectorized sampling from NHPPPs with piecewise constant intensities with same interval lengthsvdraw_sc_step_regular
Vectorized sampling from zero-truncated NHPPPs with piecewise constant intensities over arbitrary interval bounds (C++)vztdraw_sc_step
Simulate from a zero-truncated non homogeneous Poisson Point Process (zt-NHPPP) from (t_min, t_max) (order statistics method)ztdraw_cumulative_intensity
Simulate 'size' samples from a zero-truncated non homogeneous Poisson Point Process (zt-NHPPP) from (t_min, t_max) with linear intensity functionztdraw_sc_linear
Simulate from a zero-truncated non homogeneous Poisson Point Process (zt-NHPPP) from (t_min, t_max) with a log-linear intensity functionztdraw_sc_loglinear
Simulate a count-conditioned homogeneous Poisson Point Process over (t_min, t_max]ztppp