ctmm-initiative / ctmm

Continuous-Time Movement Modeling. Functions for identifying, fitting, and applying continuous-space, continuous-time stochastic movement models to animal tracking data.
http://biology.umd.edu/movement.html
43 stars 10 forks source link

Consider caching expensive calculations with `memoise`? #15

Closed xhdong-umd closed 6 years ago

xhdong-umd commented 6 years ago

There are some calculations in ctmm that take some time. In my experiments and tests I often need to run some code repetitively. I found caching them with memoise can save a lot of time.

I'm wondering if ctmm in general can adopt it. For example, you can create a cache folder under inst, and all repeat calculations with same parameters will get instant result.

chfleming commented 6 years ago

I'm not sure that I can see the benefit of this functionality on the command line?

xhdong-umd commented 6 years ago

For end user may not be obvious. I remember that when I played with the package website generator for ctmm, I need to compile some vignettes again and again in experimenting some scripts. Having those calculations cached could save some time.

Though if you don't have this kind of usage then it would not help.

chfleming commented 6 years ago

I think there is some cache functionality in the vignettes (in knitr) that I have not been using.

xhdong-umd commented 6 years ago

Yes I looked at that before and never used it. It looks a little bit complicated and not as flexible as memoise.