epinowcast / epidist

An R package for estimating epidemiological delay distributions
http://epidist.epinowcast.org/
Other
9 stars 4 forks source link

Properly discretised PMF functionality #218

Open athowes opened 1 month ago

athowes commented 1 month ago

Should we have functionality for getting a "properly" discretised PMF in this package or somewhere else?

Originally posted by @athowes in https://github.com/epinowcast/epidist/issues/210#issuecomment-2262694949

In PR #210 we added functionality to predict the delay distribution parameters (internal and natural scale).

A reasonable thing to want to do with these parameter samples is to get some features about the implied discretised delay distribution (e.g. a PMF).

One thing you could do to generate a sample from the delay:

  1. Draw from delay parameters (empirically from the draws we have available)
  2. Draw from delay distribution

This would get you a continuous delay draw.

Then what you could do is naively discretised that draw to get a PMF. @seabbs says that this is bad and I am a bad person for having suggested it. So, we should either implement the correct thing here, or rely on some other package to do it (or we create that package).

This function in epinowcast might do what we want (but badly for some reason?).

athowes commented 1 month ago

See comment https://github.com/epinowcast/epidist/pull/210#issuecomment-2263357277 from Sam:

Should we have functionality for getting a "properly" discretised PMF in this package or somewhere else?

My vote is somewhere else so that i.e epinowcast can use it and then also use it here but we could dev something here and then port out. Note that epinowcast already has a simulate based approach to this but really the approach taken in EpiAware (numeric integration) is the way to go I think

seabbs commented 1 month ago

(but badly for some reason?)

It approximates via lots of random draws (i.e its just crude). Not bad ... just misguided