Package: nhppp 0.1.4.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>). 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_0.1.4.9000.tar.gz
nhppp_0.1.4.9000.zip(r-4.5)nhppp_0.1.4.9000.zip(r-4.4)nhppp_0.1.4.9000.zip(r-4.3)
nhppp_0.1.4.9000.tgz(r-4.4-x86_64)nhppp_0.1.4.9000.tgz(r-4.4-arm64)nhppp_0.1.4.9000.tgz(r-4.3-x86_64)nhppp_0.1.4.9000.tgz(r-4.3-arm64)
nhppp_0.1.4.9000.tar.gz(r-4.5-noble)nhppp_0.1.4.9000.tar.gz(r-4.4-noble)
nhppp_0.1.4.9000.tgz(r-4.4-emscripten)nhppp_0.1.4.9000.tgz(r-4.3-emscripten)
nhppp.pdf |nhppp.html
nhppp/json (API)
NEWS

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

Peer review:

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

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

On CRAN:

40 exports 1 stars 1.51 score 6 dependencies 3 scripts 894 downloads

Last updated 4 months agofrom:71bdbb2d98. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 05 2024
R-4.5-win-x86_64OKSep 05 2024
R-4.5-linux-x86_64OKSep 05 2024
R-4.4-win-x86_64OKSep 05 2024
R-4.4-mac-x86_64OKSep 05 2024
R-4.4-mac-aarch64OKSep 05 2024
R-4.3-win-x86_64OKSep 05 2024
R-4.3-mac-x86_64OKSep 05 2024
R-4.3-mac-aarch64OKSep 05 2024

Exports:drawdraw_cumulative_intensity_inversiondraw_cumulative_intensity_orderstatsdraw_intensitydraw_intensity_stepdraw_sc_lineardraw_sc_loglineardraw_sc_stepdraw_sc_step_regularget_step_majorizerinverse_with_unirootinverse_with_uniroot_sortedppp_nppp_next_nppp_orderstatppp_sequentialrng_stream_rexprng_stream_rpoisrng_stream_runifrng_stream_rztpoisrztpoissimpson_num_integrvdrawvdraw_intensity_step_regularvdraw_intensity_step_regular_cppvdraw_intensity_step_regular_Rvdraw_sc_step_regularvdraw_sc_step_regular_cppvdraw_sc_step_regular_Rvztdraw_intensity_step_regularvztdraw_intensity_step_regular_Rvztdraw_sc_step_regularvztdraw_sc_step_regular_cppvztdraw_sc_step_regular_Rztdraw_cumulative_intensityztdraw_intensityztdraw_intensity_stepztdraw_sc_linearztdraw_sc_loglinearztppp

Dependencies:cligluelifecycleRcpprlangrstream

Readme and manuals

Help Manual

Help pageTopics
Check the validity of ppp samplescheck_ppp_sample_validity
Check the validity of a ppp vector.check_ppp_vector_validity
Check that two ppp vectors Q-Q agreecompare_ppp_vectors
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) from (t_min, t_max) (inversion method)draw_cumulative_intensity_inversion
Simulate from a non homogeneous Poisson Point Process (NHPPP) from (t_min, t_max) (order statistics method)draw_cumulative_intensity_orderstats
Simulate from a non homogeneous Poisson Point Process (NHPPP) from (t0, t_max) (thinning method)draw_intensity
Simulate from a non homogeneous Poisson Point Process (NHPPP) from (t0, t_max) (thinning method) with piecewise constant_majorizerdraw_intensity_step
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
Helper functionsexpect_no_error
Piecewise constant (step) majorizer for K-Lipschitz functions over an interval (vectorized over the 'breaks' argument).get_step_majorizer
Numerically evaluate the inverse of a function at a specific pointinverse_with_uniroot
Numerically evaluate the inverse of a monotonically increasing continuous function from R to R at specific points.inverse_with_uniroot_sorted
Definite integral of 'l = exp(alpha + beta*t)' at time 't' with 'L(t0) = 0'Lambda_exp_form
Inverse of the definite integral of 'l = exp(alpha + beta*t)' at time 't'Lambda_inv_exp_form
Inverse of the definite integral of 'l = alpha + beta*t' at time 't'Lambda_inv_linear_form
Definite integral of 'l = alpha + beta*t' at time 't' with 'L(t0) = 0'Lambda_linear_form
Helper function for the vectorized versions of sampling functions. Takes the usual ways that 'lambda_mat' and 'Lambda_mat' are specified and returns 'Lambda_mat'.make_cumulative_Lambda_matrix
Helper function for the vectorized versions of sampling functions. Takes the usual ways that 'lambda_mat' and 'Lambda_mat' are specified and returns 'lambda_mat'.make_lambda_matrix
Helper function for the vectorized versions of sampling functions. Takes the usual ways that 'range_t' is specified (a 2-vector, a 1 x 2 or an r x 2 matrix) and returns a r x 2 matrix.make_range_t_matrix
Return matrix with column-wise cumulative sum No checks for arguments is done.mat_cumsum_columns
Return matrix with column-wise cumulative sum replacing cells larger than 'ceil' with 'NA'. No checks for arguments is done.mat_cumsum_columns_with_scalar_ceiling
Return matrix with column-wise cumulative sum replacing cells larger than 'ceil' with 'NA'. No checks for arguments is done.mat_cumsum_columns_with_vector_ceiling
Return matrix with column-wise differencing. No checks for arguments is done.mat_diff_columns
Simulate specific number of points from a homogeneous Poisson Point Process over (t_min, t_max]ppp_n
Simulate n events from a homogeneous Poisson Point Process.ppp_next_n
Simulate a homogeneous Poisson Point Process over (t_min, t_max] (order statistics method)ppp_orderstat
Simulate a homogeneous Poisson Point Process over (t_min, t_max]ppp_sequential
Read code from text file as stringread_code
Exponential random samples from 'rstream' objectsrng_stream_rexp
Poisson random samples from 'rstream' objectsrng_stream_rpois
Uniform random samples from 'rstream' objectsrng_stream_runif
Zero-truncated Poisson random samples from 'rstream' objectsrng_stream_rztpois
Zero-truncated Poisson random samples (basic R)rztpois
Simpson's method to integrate a univariate function.simpson_num_integr
Vectorized generic function for simulating from NHPPPs given the intensity function or the cumulative intensity functionvdraw
Vectorized sampling from a non homogeneous Poisson Point Process (NHPPP) from an interval (thinning method) with piecewise constant_majorizers (C++)vdraw_intensity_step_regular
Vectorized sampling from a non homogeneous Poisson Point Process (NHPPP) from an interval (thinning method) with piecewise constant_majorizers (C++)vdraw_intensity_step_regular_cpp
Vectorized sampling from a non homogeneous Poisson Point Process (NHPPP) from an interval (thinning method) with piecewise constant_majorizers (R)vdraw_intensity_step_regular_R
Vectorized sampling from NHPPPs with piecewise constant intensities with same interval lengths (R)vdraw_sc_step_regular
Vectorized sampling from NHPPPs with piecewise constant intensities with same interval lengths (C++)vdraw_sc_step_regular_cpp
Vectorized sampling from NHPPPs with piecewise constant intensities with same interval lengths (R)vdraw_sc_step_regular_R
Vectorized sampling from a zero-truncated non homogeneous Poisson Point Process (NHPPP) from an interval (thinning method) with piecewise constant_majorizersvztdraw_intensity_step_regular
Vectorized sampling from a zero-truncated non homogeneous Poisson Point Process (NHPPP) from an interval (thinning method) with piecewise constant_majorizers (R)vztdraw_intensity_step_regular_R
Vectorized sampling from zero-truncated NHPPPs with piecewise constant intensities with same interval lengthsvztdraw_sc_step_regular
Vectorized sampling from zero-truncated NHPPPs with piecewise constant intensities with same interval lengths (C++)vztdraw_sc_step_regular_cpp
Vectorized sampling from zero-truncated NHPPPs with piecewise constant intensities with same interval lengths (R)vztdraw_sc_step_regular_R
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 (t0, t_max) (thinning method)ztdraw_intensity
Simulate from a zero-truncated non homogeneous Poisson Point Process (NHPPP) from (t0, t_max) (thinning method) with piecewise constant_majorizerztdraw_intensity_step
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 function (inversion method)ztdraw_sc_loglinear
Simulate a zero-truncated homogeneous Poisson Point Process over (t_min, t_max]ztppp