Package: primarycensored 1.5.0

Sam Abbott

primarycensored: Primary Event Censored Distributions

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.

Authors:Sam Abbott [aut, cre, cph], Sam Brand [aut], Adam Howes [ctb], James Mba Azam [aut], Carl Pearson [aut], Sebastian Funk [aut], Kelly Charniga [aut]

primarycensored_1.5.0.tar.gz
primarycensored_1.5.0.zip(r-4.7)primarycensored_1.5.0.zip(r-4.6)primarycensored_1.5.0.zip(r-4.5)
primarycensored_1.5.0.tgz(r-4.6-any)primarycensored_1.5.0.tgz(r-4.5-any)
primarycensored_1.5.0.tar.gz(r-4.7-any)primarycensored_1.5.0.tar.gz(r-4.6-any)
primarycensored_1.5.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
primarycensored/json (API)
NEWS

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

Bug tracker:https://github.com/epinowcast/primarycensored/issues

Pkgdown/docs site:https://primarycensored.epinowcast.org

Datasets:

On CRAN:

Conda:

censoringdistributionsmc-stantruncation

8.46 score 9 stars 2 packages 25 scripts 661 downloads 28 exports 0 dependencies

Last updated from:1ea1d80af0 (on v1.5.0). Checks:7 ERROR, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64ERROR149
source / vignettesOK208
linux-release-x86_64ERROR148
macos-release-arm64ERROR127
macos-oldrel-arm64ERROR134
windows-develERROR98
windows-releaseERROR90
windows-oldrelERROR71
wasm-releaseOK115

Exports:add_name_attributecheck_dprimarycheck_pdistcheck_truncationdexpgrowthdpcensdprimarycensoredfitdistdoublecensnew_pcenspcd_as_stan_datapcd_cmdstan_modelpcd_dist_namepcd_load_stan_functionspcd_stan_dist_idpcd_stan_filespcd_stan_function_depspcd_stan_functionspcd_stan_pathpcens_cdfpcens_quantilepexpgrowthppcenspprimarycensoredqpcensqprimarycensoredrexpgrowthrpcensrprimarycensored

Dependencies:

Analytic solutions for censored delay distributions

Rendered fromanalytic-solutions.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-04-22
Started: 2024-09-24

Getting started with primarycensored

Rendered fromprimarycensored.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-02-12
Started: 2024-10-09

Why it works

Rendered fromwhy-it-works.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-04-22
Started: 2024-09-18

Readme and manuals

Help Manual

Help pageTopics
Helper method for custom distributionsadd_name_attribute
Check if a function is a valid bounded probability density function (PDF)check_dprimary
Check if a function is a valid cumulative distribution function (CDF)check_pdist
Check if truncation time is appropriate relative to the maximum delaycheck_truncation
Compute the primary event censored PMF for delaysdpcens dprimarycensored
Exponential growth distribution functionsdexpgrowth expgrowth pexpgrowth rexpgrowth
Fit a distribution to doubly censored datafitdistdoublecens
S3 class for primary event censored distribution computationnew_pcens
Prepare data for primarycensored Stan modelpcd_as_stan_data
Create a CmdStanModel with primarycensored Stan functionspcd_cmdstan_model
Get distribution function cdf or pdf namepcd_dist_name
Supported delay distributionspcd_distributions
Load Stan functions as a stringpcd_load_stan_functions
Supported primary event distributionspcd_primary_distributions
Get distribution stan ID by namepcd_stan_dist_id
Get Stan files containing specified functionspcd_stan_files
Get dependencies for a Stan functionpcd_stan_function_deps
Get Stan function names from Stan filespcd_stan_functions
Get the path to the Stan codepcd_stan_path
Compute primary event censored CDFpcens_cdf
Default method for computing primary event censored CDFpcens_cdf.default
Method for Gamma delay with uniform primarypcens_cdf.pcens_pgamma_dunif
Method for Log-Normal delay with uniform primarypcens_cdf.pcens_plnorm_dunif
Method for Weibull delay with uniform primarypcens_cdf.pcens_pweibull_dunif
Compute primary event censored quantilespcens_quantile
Default method for computing primary event censored quantilespcens_quantile.default
Compute the primary event censored CDF for delaysppcens pprimarycensored
Compute quantiles corresponding to target probabilities for primary event censored delaysqpcens qprimarycensored
Generate random samples from a primary event censored distributionrpcens rprimarycensored