parameters {
real y;
}
transformed parameters {
target += normal_lpdf(r | 0, 1);
}
model {
y ~ normal(0, 1);
}
was not allowed (with the target is not allowed in transformed parameters error). In stanc3 none of these are allowed.
To me this seems like a stanc2 bug, just wanted to confirm.
The allowance of a distribution call to lp through a function seems like a bug. However, it brings up the case that there should be an allowed lp increment for log-abs-det-jacobian adjustments in transformed parameters. I’m thinking a special function like increment_target() such as
It seems unnecessary in this situation but there are more complicated situations where I’m doing an adjustment in a function in transformed parameters and then I have to figure out a way to pass it to a dummy variable. This is difficult especially when one has matrices as outputs. So now I have an array of 2 matrices where matrix is my output and the other is mostly zeros except for the jacobian adjustment. Such as