primarycensored1.3.0 package

Primary Event Censored Distributions

add_name_attribute

Helper method for custom distributions

check_dprimary

Check if a function is a valid bounded probability density function (P...

check_pdist

Check if a function is a valid cumulative distribution function (CDF)

check_truncation

Check if truncation time is appropriate relative to the maximum delay

dot-dpcens

Define a fitdistrplus compatible wrapper around dprimarycensored

dot-extract_function_name

Extract base function name

dot-extract_stan_functions

Extract function names or content from Stan code

dot-format_class

Extract and Combine Distribution Names

dot-name_deprecation

Deprecation name helper

dot-normalise_cdf

Normalise a primary event censored CDF

dot-ppcens

Define a fitdistrplus compatible wrapper around pprimarycensored

dprimarycensored

Compute the primary event censored PMF for delays

expgrowth

Exponential growth distribution functions

fitdistdoublecens

Fit a distribution to doubly censored data

new_pcens

S3 class for primary event censored distribution computation

pcd_as_stan_data

Prepare data for primarycensored Stan model

pcd_cmdstan_model

Create a CmdStanModel with primarycensored Stan functions

pcd_dist_name

Get distribution function cdf or pdf name

pcd_load_stan_functions

Load Stan functions as a string

pcd_stan_dist_id

Get distribution stan ID by name

pcd_stan_files

Get Stan files containing specified functions

pcd_stan_functions

Get Stan function names from Stan files

pcd_stan_path

Get the path to the Stan code

pcens_cdf.default

Default method for computing primary event censored CDF

pcens_cdf.pcens_pgamma_dunif

Method for Gamma delay with uniform primary

pcens_cdf.pcens_plnorm_dunif

Method for Log-Normal delay with uniform primary

pcens_cdf.pcens_pweibull_dunif

Method for Weibull delay with uniform primary

pcens_cdf

Compute primary event censored CDF

pcens_quantile.default

Default method for computing primary event censored quantiles

pcens_quantile

Compute primary event censored quantiles

pprimarycensored

Compute the primary event censored CDF for delays

primarycensored-package

primarycensored: Primary Event Censored Distributions

qprimarycensored

Compute quantiles corresponding to target probabilities for primary ev...

rprimarycensored

Generate random samples from a primary event censored distribution

Provides functions for working with primary event censored distributions and 'Stan' implementations for use in Bayesian modeling. Primary event censored distributions are useful for modeling delayed reporting scenarios in epidemiology and other fields (Charniga et al. (2024) <doi:10.48550/arXiv.2405.08841>). It also provides support for arbitrary delay distributions, a range of common primary distributions, and allows for truncation and secondary event censoring to be accounted for (Park et al. (2024) <doi:10.1101/2024.01.12.24301247>). A subset of common distributions also have analytical solutions implemented, allowing for faster computation. In addition, it provides multiple methods for fitting primary event censored distributions to data via optional dependencies.

  • Maintainer: Sam Abbott
  • License: MIT + file LICENSE
  • Last published: 2025-12-01