Two things.
First, these aren't consistent:
> real<lower=0> sigma_unif;
> sigma_unif ~ uniform(0,sigma);
You need to declare sigma_unif with upper=sigma in order to do this.
Every parameter value satisfying constraints should have a finite
log density.
But we don't really recommend those hard constraints for
statistical and computational reasons (you get bias when the
artificial bound isn't way out in the tail of a more diffuse
prior).
Second, you need to use a non-centered parameterization for a
hierarchical model like this (it's like an 8-schools/measurement
error model). That's described in the manual.
You'll want to do the same thing for WinBUGS, by the way.
Try starting WinBUGS from the same diffuse initializations
as Stan uses and then evaluate four chains using Stan's
Rhat calculations. They're much more conservative and use
cross-chain information to discount n_eff when there hasn't
been good convergence.
- Bob
> On Apr 21, 2017, at 5:06 PM, Chunlei Zhang <
chun...@gmail.com> wrote:
>
> Q75 Q97.5 Rhat n.eff
> 0.000196 0.001463 1.006882 447
> 0.001196 0.002969 1.000705 7075
> 0.001483 0.003207 1.000177 5973
> 0.001326 0.003473 1.000489 8455
>
> The above is a sample from the RStan output. The iter=110000, but n.eff could be 447 or even less. Why? Use same model, same data, WinBUGS would have much larger n.eff.
>
>
> On Friday, April 21, 2017 at 4:40:56 PM UTC-4, Chunlei Zhang wrote:
> Hello,
>
> I used Rstan to do a Bayesian Hierarchical One-Level Model. The question I would ask is why the effective sample size (n.eff) from the Rstan output is much smaller then WinBUGS'. Rstan (3-7th columns) and WinBUGS (8-12th columns) for the same dataset with exactly same number of iterations and burn-in samples. Below is an output example.
>
>
> --
> 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.