Package: primarycensored 1.1.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 [ctb], Carl Pearson [aut], Sebastian Funk [aut], Kelly Charniga [aut]

primarycensored_1.1.0.tar.gz
primarycensored_1.1.0.zip(r-4.5)primarycensored_1.1.0.zip(r-4.4)primarycensored_1.1.0.zip(r-4.3)
primarycensored_1.1.0.tgz(r-4.5-any)primarycensored_1.1.0.tgz(r-4.4-any)primarycensored_1.1.0.tgz(r-4.3-any)
primarycensored_1.1.0.tar.gz(r-4.5-noble)primarycensored_1.1.0.tar.gz(r-4.4-noble)
primarycensored_1.1.0.tgz(r-4.4-emscripten)primarycensored_1.1.0.tgz(r-4.3-emscripten)
primarycensored.pdf |primarycensored.html
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 site:https://primarycensored.epinowcast.org

Datasets:

On CRAN:

censoringdistributionsmc-stantruncation

7.69 score 8 stars 1 packages 16 scripts 519 downloads 24 exports 5 dependencies

Last updated 10 days agofrom:754df518a0 (on v1.1.0). Checks:1 OK, 7 ERROR. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKFeb 10 2025
R-4.5-winERRORFeb 10 2025
R-4.5-macERRORFeb 10 2025
R-4.5-linuxERRORFeb 10 2025
R-4.4-winERRORFeb 10 2025
R-4.4-macERRORFeb 10 2025
R-4.3-winERRORFeb 10 2025
R-4.3-macERRORFeb 10 2025

Exports:add_name_attributecheck_dprimarycheck_pdistcheck_truncationdexpgrowthdpcensdprimarycensoredfitdistdoublecensnew_pcenspcd_as_stan_datapcd_cmdstan_modelpcd_dist_namepcd_load_stan_functionspcd_stan_dist_idpcd_stan_filespcd_stan_functionspcd_stan_pathpcens_cdfpexpgrowthppcenspprimarycensoredrexpgrowthrpcensrprimarycensored

Dependencies:cligluelifecyclepracmarlang

Analytic solutions for censored delay distributions

Rendered fromanalytic-solutions.Rmdusingknitr::rmarkdownon Feb 10 2025.

Last update: 2025-02-10
Started: 2024-09-24

Getting Started with primarycensored

Rendered fromprimarycensored.Rmdusingknitr::rmarkdownon Feb 10 2025.

Last update: 2025-02-10
Started: 2024-10-09

Why it works

Rendered fromwhy-it-works.Rmdusingknitr::rmarkdownon Feb 10 2025.

Last update: 2025-02-10
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 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 the primary event censored CDF for delaysppcens pprimarycensored
Generate random samples from a primary event censored distributionrpcens rprimarycensored