Primarycensoreddist: Primary Event Censored Distributions in R and Stan

New package that aims to replace epinowcast::simulate_double_censored(), the current approaches to handling pmfs in the various convolution packages we support, and provides likelihoods for fitting censored and truncated delays inspired by some of the work @sambrand and I (mostly Sam) are doing in EpiAware. Its also very heavily based on all the work that @sangwoopark @kcharniga2 and @athowes have been doing and hopefully will feed into more similar work.

It’s still early stages but I expect the R interface to be stable. Seeing some numerical issues in the grad calls when using the models for fitting that mean may need to change up the stan side interface a bit (see the issues for more discussion).

This also represents some thinking about Streamlining of epi modeling tools - #13 by adrianlison in the sense that ideally this could be used as a dependency to provide stan code for calculating PMFs across packages in a more “correct” way. The initial targets for that would be epinowcast, epidist, and EpiNow2 so developers from those packages’ thoughts are particularly useful.

Lots of rough edges so feedback (ideally via issues) very welcome. Contributions are also very very welcome as ever.

There is also an issue for anyone who fancies dealing with solving some integrals analytically which could be fun and improve performance.

There is now a 0.3.0 release that has stable stan likelihoods and model wrappers for both fitdistplus and stan. There is also a fairly complete set of documentation to walk through the package functionality.

The next release is targeting integrating analytical solutions (from @sambrand ) for common uses cases which should give a nice speed bump vs the more generic numerical approach.

1 Like