edunford / tidysynth

A tidy implementation of the synthetic control method in R
Other
98 stars 14 forks source link

Memoise/cache option #2

Open grantmcdermott opened 3 years ago

grantmcdermott commented 3 years ago

This package looks super, thanks for putting it together.

Quick request as per our Twitter convo: I think it could useful to add a memoisation/caching option to synthetic_control (or generate_weights).

There are several potential advantages to this. But the particular use-case that I'm thinking of is running a large placebo trial where, say, a single placebo fails because a tolerance issue. Instead of having to rerun the entire ensemble from scratch, we could then just tweak the tolerance for that single placebo and load the remaining results from the cache.

The one tricky thing is how to pass a bespoke argument (or set of arguments) that only maps to that individual placebo and not everything else. E.g. As it it stands, tweaking the general sigf_ipopargument would propagate to the entire ensemble and thus invalidate the cache.