epiforecasts / RtD3

Rt visualisation in D3
https://epiforecasts.io/RtD3/
Other
6 stars 2 forks source link

Support user specified/learnt from data CrIs #42

Open seabbs opened 3 years ago

seabbs commented 3 years ago

In a recent update to EpiNow2 we have added user options around the credible intervals returned (epiforecasts/EpiNow2#105) this means that any number and range of credible intervals can now be returned (in the format lower_90, lower_50, lower_20, upper_20, upper_50, upper_90) with the default being the 20%, 50% and 90% CrI.

It would be good to support this feature in RtD3 as this is also a major blocker for other groups estimating Rt from adopting this package (as they are likely outputing (or want to visualise) different credible intervals)

hamishgibbs commented 3 years ago

Agreed that this will improve the usability of the package for others not using the same CIs.

I will think how to best do this for an arbitrary number of CIs at arbitrary intervals. Will probably be some lookup for colours at x interval for the 3 time periods - We could select the colour for each time interval from a single CI to make the time series legend.

If the lower_ upper_ pattern is sure to be the same it will make things easier - could pass a color reference like {'ci':57, 'estimated':'green', 'estimated_b':'blue', 'forecast':'red'} then append the civalue to lower_ and upper_ pattern and visualise those values.

hamishgibbs commented 3 years ago

@seabbs is the lower_ upper_ pattern sure to be the same?

hamishgibbs commented 3 years ago

Probably best to do this - then release to CRAN - #17? Rather than releasing and then immediately releasing again.

seabbs commented 3 years ago

Yes from EpiNow2 it will be the same and obviously can make this a package requirement.

There is a helper function in (EpiNow2::extract_CrI) that pulls out the CrIs present which might be helpful or could provide some level of template for the R code.

seabbs commented 3 years ago

In terms of CRAN I think it is valid doing either. When first on CRAN can make frequent updates with no issue. Perhaps would be good to get it up and then deal with this for the next release?