Skip to content

Possible mistake in dual average implementation #27

@aseyboldt

Description

@aseyboldt

There's a difference in the dual averaging algorithm in stan/nutpie and walnuts, and it looks to me like a typo, not an intended change?

In the walnuts implementation log_est_avg is updated based only on log_est_ and last_log_est:
https://github.com/flatironinstitute/walnuts/blob/main/include/walnuts/dual_average.hpp#L103

In stan it is updated based on the last log_est_avg value and the current log_est value (called x_bar_ and x in that codebase):
https://github.com/stan-dev/stan/blob/develop/src/stan/mcmc/stepsize_adaptation.hpp#L68

This might explain why the step size adaptation works better with different parameters in the walnuts codebase?

I tried the new walnuts parameters from #25 in nutpie (which matches the stan impl at least in that regard at least), and I don't get good estimates (one color per chain):

Image

compared to the old parameters:

Image

(I accidentally opened an issue in the old walnuts repo first: bob-carpenter/walnuts#48)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions