1. To keep on Andrew's terminological kick, what you're calling a
latent variable, we just call a parameter. We reserve the term
"latent" for some particular kinds of things, like latent predictors
in an IRT model or latent continuous values in a classification problem.
To be precise, we drop constant terms (those that only depend on data, x)
where we can figure it out automatically. So if you do
z ~ normal(0,10);
in the modeling language you don't get the -log(10) term that you'd get
if 10 were a parameter.
And it doesn't have to be a log joint, just something proportional
to the posterior of interest.
2. Correct.
3. I find it helps to not use the same variable z for f(z) and f^{-1}(z).
But that's not an issue.
For reference, the transforms are all outlined in the penultimate chapter
of the manual on transformations of variables.
You should be using Eigen::Matrix<double, Eigen::Dynamic, 1> for
some_z in the call to gradient(), not Eigen::blablabla for any other
value of blablabla.
In that case, you should be getting \nabla_z \psi(z), where \psi(z) is
defined up to an additive constant.
- Bob
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
stan-dev+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
> <question_to_stan-dev.pdf>