Open karimn opened 4 years ago
There's 2 things:
tail()
" on lines 227 and 235, which you just mentionedfor (day_index in 1:total_days[curr_subnat_pos])
by a factor of m, by having a convolution on series of m days.I think the latter gives a more obvious speed-up (at the cost of discarding some information)
But that loop is needed to calculate the Rt, Rt_adj, new_cases,
and mean_deaths
. The number of iterations is based on the number of days we have data for.
But that loop is needed to calculate the
Rt, Rt_adj, new_cases,
andmean_deaths
. The number of iterations is based on the number of days we have data for.
So it would calculate all of these quantities, but at a m-day interval (rather than 1-day).
Now that I write this, since the speed-up would be inversely proportional to m, maybe that is not so great. We maybe don't care if the model runs 8hrs instead of 16hrs?
Ok, I get it now!
From 16 to 8 would be a worthy improvement if possible.
Yes, but extra data formatting. We could have an option for the script which, if TRUE, groups days into consecutive 2-day pairs and 1) sums deaths, 2) averages mobility. Apart from changing N days in each subunit, we also need to pass a generating function which uses integral from -1 to 1 rather than -0.5 to 0.5. But other than that I think it's all the same?
PS: So this option could be good for troubleshooting. For new countries maybe running a more approximate model on full data in half/third/fifth of the time is beneficial, we can always run with full data later on.
Implementation changes to accommodate merging days:
This is now implemented but does not produce stable results. Converting this to a bug and putting it back on the todo list.
@wwiecek I'm having doubts about how effective this would be. It would end putting zeros near the tail end of of the convolution discretized
rev_gen_factor
andrev_time_to_death
, right? If you look at lines 227 and 235 in the main-karimn branch, you'll see that wouldn't really reduce computation by much. Maybe I'm missing something. What do you think?