Sorry --- we seem to have missed your question the first time around.
Please pester us if we don't answer within a day or two. We'd
like to at least respond to 100% of the queries.
First, the Stan code you attached is rather large and has scary
hard-coded bits in it like this:
if(i == 1 || i == 11 || i == 20 || i == 28 || i == 35 || i == 41 ||i == 46 ||i == 50 || i == 53 || i == 55){
cum[i] ~ normal(log(ult[origin[i]]) + weibull_cdf_log(dev[i], omega, theta),sigma) ;
}
Did you try just implementing a simpler version of the model you
attached as a PDF first and then building out?
I don't know if your model's converging or not, but
these priors are problematic.
theta ~ normal(47,1); // scale parameter
omega ~ normal(1.3, 0.1); // shape parameter
mu_ult ~ normal(5000, 5);
sigma ~ gamma(500, 1);
tau_ult ~ gamma(.0001, .0001);
First, you don't need to put a prior directly on precision
in Stan--- we just put priors directly on sigma. Second, those
overly vague gamma (or inverse gamma) priors are bad news
as described by Andrew in several papers (see the reference manual
for references and alternatives). Third, it's better to rescale
parameters like mu_ult so they're not on the order of 5000. Stan
has to do a lot of work during adaptation if they're order 5000.
Is that shape parameter omega really constrained to standard deviation 0.1?
For this:
ult ~ normal(mu_ult, sigma_ult);
it may help to use a non-centered parameterization. Especially
with mu_ult being around 5000! It would have to adapt all the ult
values with the model as you gave it.
ult_raw ~ normal(0, 1);
and then transform to:
ult <- mu_ult + ult_raw * sigma_ult;
You don't define sigma as a transformed parameter, but
then you give it a distribution, which may be the cause of
your problems.
- Bob
> On Jun 12, 2016, at 4:23 PM,
olivier....@student.uclouvain.be wrote:
>
> Hello,
>
>
> I am trying to implement the model specified in Figure Model.png with the data given in data.csv. The difference is that I do not use the index 'k' and that p_{ik}\gamma_{ik} is replaced by ULT_{i}.
> My implementation is included in ModelPaper.R . I get very strange results for the random effect ULT and have no idea what I am doing wrong. Any help would be appreciated!
>
>
> Kind regards,
>
> Olivier
>
> --
> 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.
> <Model.png><data.csv><ModelPaper.R>