There are already a few threads on the subject, but I'm not interested in a particular model. Rather, I'm just observing that models with explicitly correlated parameters are a bit quirky in Stan. I'm curious if people out there have a lot of success with explicitly correlated parameters versus the implicit case. I'm also curious about best practices on when to use them and when to not use. My thoughts are below.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/Zuz9CHJ0aSU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
It's actually not too bad to write stan_glmer's decov prior yourself if you want to do it in your Stan program. The prior is explained here
https://cran.r-project.org/web/packages/rstanarm/vignettes/glmer.html#priors-on-covariance-matrices
and it involves not only the LKJ for the correlation matrix (or preferably it's cholesky decomposition), but then it also does a reparameterization of the scale parameters.
Jonah
Thanks Jonah. There are similar recommendations in the Stan model. I have tried them. Sometimes they work for me, but not always.Have you had much success with them? I would be interested in your experiences.
@Jonah, Sorry, I must have skipped over that detail. No, that's not the approach I took. I used an LKJ prior on the correlation with half normal priors on the standard deviations.
Have you found more success with your approach?
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/Zuz9CHJ0aSU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
The hierarchical model can often collapse because
normal_lpdf(y | mu, sigma) is unbounded as sigma -> 0 and y -> mu.
That's why you can't do ordinary optimization or MLE with them.
You can get identifiability problems if you add in intercepts
and intercepts for the priors, because you essentially get two
intercepts. This is the kind of thing that often gets identified
with priors.
If you're finding the real data a lot harder to fit than simulated
data, you might want to try to diagnose where the actual data's
violating the modeling assumptions.
What I'm saying is that if you have multiple intercepts (say one
global one and then group-level intercepts), then you only get
identification through the prior because you can add to the global
intercept and subtract from the group intercepts and get the same
value. Usually this is mitigated with using n-1 intercepts if
there are n groups and pinning one to zero.
You're making a normal-normal model of B_n in the first case and a normal
model in the second case. I don't think you want to do the former unless
you have some kind of explicit measurement-error model, and even then, it's
usually on the data side.
Yup, challenging, but usually worth the effort in model understanding and
peace of mind that your code works.
How are you assessing bias? Are you talking about the posterior
mean as an estimate of the parameter? I'd recommend looking at posterior
interval coverage for simulated data --- that'll let you assess whether
your model's coded properly. Then it's a different matter to asses whether
it matches some real data set.
This is a key step in debugging. Isolate the problem in
a reproducible example that is as simple as possible. Often
by the time you've done that, the debugging job is done.
This is one of the main reasons we suggest building models
up from simpler models wherever possible. It's tedious to
build up one feature at a time, but at least you know exactly
where the problem comes from when it arises.
> cor(alpha_new[(alpha_new ^ 2)>0.000025] ^ 2, log(sigma_new[(alpha_new ^ 2)>0.000025])) [1] 0.5878579 > cor(alpha_new[(alpha_new ^ 2)<0.000025] ^ 2, log(sigma_new[(alpha_new ^ 2)<0.000025])) [1] -0.09757556
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/Zuz9CHJ0aSU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/Zuz9CHJ0aSU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/Zuz9CHJ0aSU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.