Diagnostics file column names


I have a model with a poorly behaving parameter foo, I has a lower and upper bound set in its definitions (<lower=..., upper=...>) and when I look at the diagnostic file I see columns name foo, p_foo, and g_foo.

foo is the parameter foo on the unconstrained scale (so I can recover what’s in the output file by doing foo * (upper - lower) + lower, but I don’t know what p_foo or g_foo are. Is this documented somewhere?

Yes I’ve been using Stan for this long and whenever I want to work with constrained parameters I just transform them manually b/c it’s been simpler to understand what all the math is doing… I think I get it now so I’d like to use this fancy syntax more.


p_foo is momentum and g_foo is gradient. It is documented somewhere; perhaps the CmdStan manual.