We can provide any number of built-in auto-transforms.
parameters {
real y;
}
transformed parameters {
real exp_y;
exp_y <- exp_transform(y);
}
which would compile to:
exp_y = exp_transform(y,lp__);
where we define exp_transform(y,lp__) by:
lp__ += y; // log Jacobian of exp(y) transform
return exp(y);
This would be a cinch to build. We already
have the transforms Stan itself uses implemented
this way. It only takes a bit of work on the parser
side to add the lp__ argument automatically.
What kind of transforms would be useful?
- Bob