I don't know much about this kind of model, but we have been
tinkering with the multivariate error checking, so that may
be causing problems. But that's probably not the root cause of
the problem.
For both statistical efficiency (high n_eff per iteration)
and computational efficiency (fast iterations), this model
needs to be rewritten with Cholesky factor parameters. The
problem is that we can't literally do that for your model because
we don't (yet) have (inverse) Wishart densities with Cholesky-factor
parameters.
We'd recommend using a correlation matrix parameterization and
an LKJ prior on correlation matrixes. There's a section in the regression
chapter of the 2.5 manual that explains how to code it.
As written, the y[k] where firstyear[k] == 1 will be problematic because
the model doesn't provide the same support as the parameter
declaration for y, which is unconstrained. This will kill any trajectory
explored by the sampler that moves into a region where the density
is 0 (outside min_y and max_y).
If you really need that uniform density with limited support, you
need to declare a different parameter vector with constraint
<lower=min_y,upper=max_y> for the parameters y[k] for which
firstyear[k] == 1. But it'll probably be easier just to put
a normal density such as
normal((max_y - min_y)/2, (max_y - min_y)/4);
For computational efficiency, the best thing to do would be to use
the vector form of all the densities. It'll probably speed up the
code by a factor of 2 to 10 depending on dimensionality. It'd
be a bit tricky with the switch on firstyear[k] == 1 unless you
define two local vectors (or even better a separate parameter vectors)
for the k such that firstyear[k] == 1; this is a separate motivation
to the constraint).
- 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.
> For more options, visit
https://groups.google.com/d/optout.
> <ddatasim.txt><coralss7.stan><coralss_short.R><sessionInfo.txt><tmatch.txt><yrefs.txt>