You're maxing out treedepth, which indicates a problem with
the model (you probably get warnings about hitting max treedepth),
and causes computational problems because you won't hit the U-turns
and will wind up devolving to a simple diffusion.
I would try simulating from the model and seeing if you can
fit it. If there's a bad misspecification (model doesn't fit
data well), then sampling can be a problem. It's also good
to help debugging.
If you look at the posterior, you shoudl be able to detect
(for example, with the pairs() plot restricted to a subset
of parameters), if there's non-identifiability (very highly
correlated parameters).
I have no idea what that gamma0 function is supposed to
be doing and how it affects what's going on. You don't need to assign
to r and then return r by the way. You can just return the
expression directly.
Some general suggestions:
Non-centered parameterizations for the hierarchical parameters. For
example, instead of
> tau ~ normal(0,sigma_tau);
you can define a parameter tau_raw and set
tau <- tau_raw * sigma_tau;
and take
tau_raw ~ normal(0, 1);
You can do this for lognormals, but it's trickier.
I would also suggest more informative priors. But you should
look where your fit values go. If values are running away into
long tails, you definitely want priors.
Use Stan's built-in random inits --- you shouldn't need to
specify them yourself.
- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
stan-users+...@googlegroups.com.
> To post to this group, send email to
stan-...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
> <Dataset_test_full.txt>