epinowcast / epidist

Estimate epidemiological delay distributions with brms
http://epidist.epinowcast.org/
Other
12 stars 5 forks source link

Handling of datetimes in `as_epidist_linelist` #415

Open athowes opened 2 hours ago

athowes commented 2 hours ago

In as_epidist_linelist we accept lower and upper bounds on dates as datetime objects.

Suppose on wants to do a one day window (perhaps most common use). The I think the current way to do that is to give:

  1. pdate_lwr as 2024-01-01
  2. pdate_upr as 2024-01-02

i.e. a difference of one day.

First, we should probably document that, because it could be confusing.

Second, I wonder if we can provide some simplified way for users to input a single day. For example an interface with just:

  1. pdate
  2. sdate

and then these get converted into upper and lower bounds. This is probably the most common use case so we might want to support it.

If we don't then we might want to provide functionality to go to upper and lower bounds from pdate and sdate (this is getting quite close to "supporting" it though I suppose).

athowes commented 2 hours ago

Previous comment on this:

Better way to handle it / document when user provides dates which are the same. With how it works currently then it won't be valid I don't think because it'll go to the same date time. Alternatively we could do like lower bound for lower and upper bound for upper, then it'd work differently. I think it's actually somewhat tricky so might defer to new issue. Further, if it is indeed a one day window can we make it so that a user doesn't need to provide both lower and upper (and this is just done "magic" -- though yes fair that I've learned to be careful on this so it'd need to be clear what is