CensoredDistributions.jl: Additional censored event tools for Distributions.jl

Hi there!

New (and my first woo) package aiming to extend censoring support for distributions to include primary and secondary within-interval event censoring we see a lot of in epidemiology.

Some more extended thoughts on this and a bit of a comparison to the R/stan version of this we already had here: CensoredDistributions.jl: Julia Meets Messy Outbreak Delay Distribution Data - Epinowcast

If you want to live on the edge this gist spits out some fun unicode plots:

using Pkg
Pkg.activate(temp=true)
Pkg.add(["CensoredDistributions", "Distributions", "UnicodePlots"])
include(download("https://gist.github.com/seabbs/3cbd4e5bcdba30deec3081ba3838d556/raw/censoreddistributions-demo-gist.jl"))

Any feedback is super welcome as Julia package dev is very new to me and I struggled to find good examples/a good write up of the kind I would refer people to in R. That being said copied a lot of stuff from GitHub - gdalle/HiddenMarkovModels.jl: A Julia package for simulation, inference and learning of Hidden Markov Models. (by @gdalle) which has been very nicely done imo.

If anyone has any thoughts on what robust testing of a Julia package looks like if the aim is to use it with Autodiff keen to hear them (current plan is to use DynamicPPL.run_ad).

9 Likes

Thanks for this package! The documentation looks very impressive!

Non-epidemiologists like me would benefit a lot from a clear mathematical definition of primary and secondary within-interval event censoring - deciphering this from words alone is very difficult. I think you have already all definitions, it is currently a bit hidden in this section. I think it would deserve it’s own prominent section in the documentation.

1 Like

Thanks!

Walking a bit of a tricky tight rope not wanting to duplicate too much. To answer your direct question see: Why it works • primarycensored and Analytic solutions for censored delay distributions • primarycensored

Or the linked papers i.e charniga and park in the docs. There is also a write up for the primary censoring analytical solutions on its way (GitHub - epinowcast/primarycensored-paper: A repository for writing up the primarycensored).

Any suggestions for changing up the structure or pointing to other places better very welcome. Maybe you are saying that its own page that shows up on the left and linking to it from i.e the getting started would be easier to find? The downside here would be lots of sharded little pages. Maybe the getting started is not near enough the top in the docs journey as well perhaps?

Hi @seabbs, thanks for the HMM shoutout!
What do you mean by testing for use with autodiff? Do you want to test that your loglikelihood functions are differentiable?

Thanks for the links!

For me a “getting started” sections is more about the “how to use it” and less about the “what does it do”. I think the very first paragraph would be a great place for the “what”. Maybe just ending this paragraph with “See this sections for formal definitions.” is all that is needed.