Dear Andrew,
thanks for the quick reply.
On 10/20/2015 01:17 AM, Andrew Gelman wrote:
> Hi, here are some quick thoughts:
> 1. We recommend putting the Stan program in a separate .stan file rather than encoding it as a character string. That’ll be easier when you want to fit the model more than once.
Great, I was already wondering how to make use of that feature (because
I read people talking about fitting models without recompiling).
> 2. Hard constraints on parameters are typically a good idea. Inherent constraints (such as sigma>0) are fine, but constraints such as <-.2,.2> are typically a badd idea. Better to use a prior, for example replacing a hard <-.2,.2> constraint by a prior such as N(0,.1) or N(0,.2).
OK, I'll try that. I must admit I was using the uniform ranges becaue I
can imagine the range from which samples are drawn more intuitively.
> 3. Similarly for the parameter you bound between 0.01 and 0.99. If it can’t be 0.995, it probably is highly unlikely to be 0.985. Etc.
That's true. The idea was to not put in any information (which I
probalby still do) but avoid extreme values that may lead to problems in
the functions ...
These parameters are acutally biases between 0 and 1 that are neutral at
0.5. Is there any prior distribution favorable for such cases?
> 4. No need to write 0 and 8 as 0.0 and 8.0.
I always do so if a language allows it. Can avoid hard-to-find erros is
statically typed languages. Also helps me to keep track whether there is
a continous range or discrete integer values.
> 5. The Cauchy priors could be a bit weak. I suggest replacing by normal or something like t_3 or t_7 if you want some long tails.
I think you may be right here. I have been following the advice from
your (2003?) paper on priors for variance parameters.Hence the Cauchys.
But I observed in the posteriors that the sigmas of many variables look
rather normally distributed.
The problem is, I have little feeling for how informative certain priors
(or contraints) may be. For simpler models in JAGS I just had it
generate prior predictive distirbutions by running the model without
data. I'm not sure if that is an option here as well.
> I suspect that none of these tips will solve your problem, but who knows? Maybe! I’m thinking it can’t hurt to put in some priors.
> A
Thanks again,
Jan
>> On Oct 19, 2015, at 7:09 PM, Jan Tünnermann <
je...@mail.upb.de> wrote:
>>
>> Dear all,
>>
>> I'm still having trouble with non-efficient sampling in my hierarchical model (I already tried some things, see earlier e-mails). Intriguingly, often all four chains behave nicely except one. Or suddenly, out of nowhere, a chain get trapped for a long period.
>>
>> I prepared a simplified* version of this model and attached it. Maybe someone can have a quick look if there are some obvious mistakes. We haven't been working with Bayesian statistics for too long and especially I switched only recently to Stan (in the hope HMC can better deal with this model).
>>
>> The general structure of the model is as follows (in bottom-up order):
>> - on the stimulus level layer: positive outcomes are binomially distributed at each level
>> - on the subject layer: a custom psychometric function describes the success rates at different levels
>> - on the group layer: parameters of the mentioned function are drawn from normal group distributions
>>
>> Many thanks and best regards
>> Jan
>>
>> * I made the following simplifications:
>> - deleted model structure of a second identical condition
>> - deleted a huge generated quantities block, mostly containing differences between the two conditions
>> - included dummy data within the script. Only 10 data sets are included, whereas the model is intended to run on 20+ data sets eventually. With half the data it is even more stubborn ...
>>
>> P.S.: I jut obtained a 3000 iterations test sample with the file that doesn't look too bad. However, I've seen this before and faced the mention problems then after 20000 iterations or so ...
>>
>> --
>> 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.
>> <evaluate-toj-full-simplified.R>
>
--
M.Sc. Jan T U E N N E R M A N N _________________________________
University of Paderborn
Faculty of Computer Science
Electrical Engineering and Mathematics
GET Lab
phone:
+49/ (0)5251/ 60 - 2219 Pohlweg 47-49
fax:
+49/ (0)5251/ 60 - 3238 D-33098 Paderborn
email:
tuenn...@get.uni-paderborn.de
Faculty of Cultural Sciences
Department of Psychology
PsyLab
phone:
+49/ (0)5251/ 60 - 3211 Warburger Straße 100
fax:
+49/ (0)5251/ 60 - 3528 D-33098 Paderborn
email:
jan.tue...@uni-paderborn.de