epinowcast / epidist

An R package for estimating epidemiological delay distributions
http://epidist.epinowcast.org/
Other
9 stars 4 forks source link

Drop need for rstan in tests using posterior #134

Closed seabbs closed 1 week ago

seabbs commented 3 weeks ago

rstan is currently required for testing convergence but we can remove this dependency if we instead use the functionality from the posteriors package.

athowes commented 1 week ago

Agree on this but unsure posterior provides functionality for divergent transitions and treedepth:

image
seabbs commented 1 week ago

I think you should be able to pull what you need from the cmdstan object? https://github.com/epinowcast/epinowcast/blob/d957b21af07c7708d8ae28fc248fffe39d453828/R/model-tools.R#L277

athowes commented 1 week ago

I found a way to do it with brms. (Which we already depend on.)

athowes commented 1 week ago

I found that running using brms it saves to stanfit so you can't access the cmdstanr class functions.

I also have been finding it hard to do it with brms directly (I got the maximum treedepth but not the number of times it has been hit).