title: prior range of uniform(0,50) vs uniform(0,500)
body: <p>I’ve just started with Bayesian analysis and rstan. I run the following really simple example (borrowed by the book Statistical Rethinking by Richard McElreath - there he's using his function but I want to code it directly in rstan)</p>
  
  <p>For sigma I want to use a non informative  prior (as suggested by the book)  <code>sigma ~ uniform(0,50)</code>
  However, the simulation faces problems and returns a sigma (mean) close to 50.  If I use a <code>uniform(0,70)</code> then the sigma is close to 70.
  But by using a much wider prior <code>sigma ~ uniform(0,500)</code> everything works fine. 
  My question is, since data’s variance is around 5 why a prior <code>uniform(0,50)</code> does not work?
  Thanks</p>
  
  <pre><code>library(rstan)
  library(rethinking)
  library(dplyr)
  
  data(Howell1)
  dat1 &lt;- Howell1
  d2 &lt;- dat1[ dat1$age &gt;= 18 , ]
  
  plot( d2$height ~ d2$weight )
  lm(d2$height ~ d2$weight) %&gt;% summary
  
  
  model.stan2 &lt;- '
  data{
   int &lt;lower=1&gt; N;
   real weight_bar;
   vector[N] height;
   vector[N] weight;
  }
  
  parameters{
   real alpha;
   real beta;
   real&lt;lower=0&gt; sigma;
  }
  model{
   vector[N] mu;
  
  // Priors
   alpha ~ normal(178, 20); 
   beta ~ lognormal(0,1); 
   sigma ~ uniform(0,50);  
  
   mu = alpha + beta*(weight - weight_bar); 
  
  // Likelihood
   height ~ normal( mu, sigma);
  }
  '
  
  stan_samples2 &lt;- stan(model_code = model.stan2, 
      data = list(
          N= nrow(d2),
          height=d2$height, 
          weight=d2$weight,
          weight_bar= mean(d2$weight)
          )
      )
  
  precis(stan_samples2)
  </code></pre>