Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch 8 schools to non-centered parameterization? #387

Closed
bob-carpenter opened this issue Feb 6, 2017 · 3 comments
Closed

switch 8 schools to non-centered parameterization? #387

bob-carpenter opened this issue Feb 6, 2017 · 3 comments
Milestone

Comments

@bob-carpenter
Copy link

Either 8 schools should be swapped out for something simpler or easy to fit, or it should be changed to non-centered parameterization. Or if it's not meant to fit, that should be somehow made apparent to users. (If it is, feel free to summarily close this issue.)

From Vishv Jeet on stan-users:

> library(rstan)
...
rstan (Version 2.14.1, packaged: 2016-12-28 14:55:41 UTC, GitRev: 5fa1e80eb817)
...
1: package ‘rstan’ was built under R version 3.2.5 
2: package ‘ggplot2’ was built under R version 3.2.5 
3: package ‘StanHeaders’ was built under R version 3.2.5 

> fit <- stan_demo('eight_schools')

Loading required namespace: rstudioapi
Warning messages:
1: There were 145 divergent transitions after warmup. Increasing adapt_delta above 0.8 may help. See
http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup 
2: There were 1 chains where the estimated Bayesian Fraction of Missing Information was low. See
http://mc-stan.org/misc/warnings.html#bfmi-low 
3: Examine the pairs() plot to diagnose sampling problems

When looked thru the shinystan I found the model code was non centered indeed.

data {
  int<lower=0> J;          // number of schools
  real y[J];               // estimated treatment effect (school j)
  real<lower=0> sigma[J];  // std err of effect estimate (school j)
}
parameters {
  real mu;
  real theta[J];
  real<lower=0> tau;
}
model {
  theta ~ normal(mu, tau); 
  y ~ normal(theta,sigma);
}
@bob-carpenter bob-carpenter added this to the Future milestone Feb 6, 2017
@bgoodri
Copy link
Contributor

bgoodri commented Feb 6, 2017

It should be fixed in example-models.

@jgabry
Copy link
Member

jgabry commented Feb 6, 2017

It would probably also be good to have both parameterizations as examples.

@bob-carpenter
Copy link
Author

bob-carpenter commented Feb 6, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants