Frequently Asked Questions

This page contains frequently asked questions about CensoredDistributions.jl. If you have a question that is not answered here, please open a discussion on the GitHub repository.

Working with Tutorials

Q: How can I run the tutorial notebooks?

A: You have two options:

Option 1: Copy and paste (easiest)

  • Copy code blocks from the online tutorials
  • Paste into your Julia REPL or script
  • Modify as needed for your analysis

Option 2: Interactive notebooks

  1. Install Pluto: ] add Pluto
  2. Clone the repository: git clone https://github.com/EpiAware/CensoredDistributions.jl.git
  3. Start Julia in the repository directory: julia --project=docs
  4. Start Pluto: using Pluto; Pluto.run()
  5. Open the .jl files in docs/src/getting-started/tutorials/

Q: What are Pluto notebooks?

A: Pluto.jl notebooks are reactive - when you change one cell, all dependent cells automatically update. This is different from Jupyter notebooks. Each cell contains either a single expression or code wrapped in begin...end or let...end blocks.

Using the Package

Q: How do I create a primary censored distribution?

A: Use the primary_censored function:

using CensoredDistributions, Distributions

# Delay distribution (e.g., incubation period)
delay_dist = Gamma(2, 3)

# Primary event distribution (e.g., infection within a day)
primary_dist = Uniform(0, 1)

# Create censored distribution
censored_dist = primary_censored(delay_dist, primary_dist)
CensoredDistributions.PrimaryCensored{Distributions.Gamma{Float64}, Distributions.Uniform{Float64}, CensoredDistributions.AnalyticalSolver{Integrals.QuadGKJL{typeof(LinearAlgebra.norm), Nothing}}}(
dist: Distributions.Gamma{Float64}(α=2.0, θ=3.0)
primary_event: Distributions.Uniform{Float64}(a=0.0, b=1.0)
method: CensoredDistributions.AnalyticalSolver{Integrals.QuadGKJL{typeof(LinearAlgebra.norm), Nothing}}(Integrals.QuadGKJL{typeof(LinearAlgebra.norm), Nothing}(7, LinearAlgebra.norm, nothing))
)

Q: What's the difference between the different types of censoring?

A:

  • Primary event censoring: The timing of the initial event in a delay distribution is uncertain. See the tutorials for detailed examples.
  • Interval censoring: Continuous values are observed only within discrete intervals. See the API documentation for interval_censored.
  • Double interval censoring: Combines both types of censoring. See double_interval_censored in the API documentation.

Q: How do I fit censored distributions to data?

A: See the Fitting with Turing.jl tutorial in the tutorials section for Bayesian inference examples using Turing.jl.

Q: Which distributions have analytical solutions for better performance?

A: See the Analytical CDF Solutions tutorial in the tutorials section for details on which distribution combinations have optimized implementations.

Q: Can I use this with automatic differentiation?

A: Yes! The package supports ForwardDiff.jl, ReverseDiff.jl, Zygote.jl, and Enzyme.jl for use with Turing.jl and other AD-based workflows.

Common Issues

Q: I get "Package not found" errors

A: Make sure you're in the right environment:

using Pkg
Pkg.activate(".")           # Activate current directory
Pkg.instantiate()           # Install dependencies
Pkg.add("CensoredDistributions")  # Add the package if needed

Q: How do I cite this package?

A: Please cite the GitHub repository and mention the version you used. Citation information for the associated paper will be added when available.

Q: I want to contribute to development

A: See the Developer FAQ and Contributing Guide for development-specific questions and guidelines.

Getting Help

Still have questions?