Running speed - phylogenetic models

I ran into a similar issue trying to fit a model with a custom family with chkptstanr.

@jsocolar is right that " chkpt_brms has a ... argument that gets passed to brms::make_stancode"

So the models compile and sample, but the errors occur after that when chkpt_brms tries to make a brmsfit object. This is because the … arguments passed to chkpt_brms by the user are not passed to make_brmsfit, so the conversion between the cmdstanr results to brmsfit cannot work. The code relevant code is:

returned_object <- make_brmsfit(formula = formula,
                                data = data,
                                path = path)

I have fixed this in a fork and submitted a pull request.

I have tested the fix, and it now works with any brms model specification, because the solution is general (I tested it with a data2 argument, failing before the fix, and working after; same with custom families).

I’m not sure if Donnald is still maintaining the package, since there have been no updates in 2 years. But I love the idea of this package, so if the PR doesn’t get processed, I plan to maintain a fork and continue fixing things as I stumble upon them.

For now installing the forked version with:

remotes::install_github("venpopov/chkptstanr")

should allow you to use the data2 argument, custom families, etc. It also includes a fix for another major issue for stan_code_path not found.

3 Likes