Is the doc here written backwards: https://mc-stan.org/docs/2_23/reference-manual/affinely-transformed-scalar.html?
Just comparing it to this it seems so: https://mc-stan.org/docs/2_23/reference-manual/lower-bound-transform-section.html
By backwards I mean we want to put a sampling statement on Y, but the unconstrained space is written in terms of X and so the last equation with p_X and p_Y isn’t what we want.
I guess both spaces are unconstrained there but I mean unconstrained space as in the sampler’s coordinates.
The thing that bothers me is the log(0)
/log(1/0)
that’ll come with the Jacobian.
I just don’t expect that error/warning to mean anything unless someone actually just types <multiplier = 0>
(or otherwise uses a parameter that is actually constrained to zero).
If we wanted to avoid this error, we could:
-
Work on the log scale (provide a
log_multiplier
option? But then it’s still easier to just providelog(sigma)
thansigma
on a log scale) -
Change the offset multiplier transformation to y = \mu + (\sigma + 10^{-300}) x (or whatever the smallest positive double value is).
1 would take compiler work to be effective and 2 is just playing numeric games to make sure the error never happens.
I think it makes sense to just axe the error, or I’m pretty sure 2 + a non-negative check on sigma would be fine as well.