title: Estimating parameters using stan when the distribution for response variable in a regression is non-normal
body: <p>I am using <code>R+stan</code> for <code>Bayesian estimates</code> of model parameters when the distribution for response variable in a regression is not normal but rather some custom distribution as below.</p>
  <p>Let say I have below data generating process</p>
  <pre><code>x &lt;- rnorm(100, 0, .5)
  noise &lt;- rnorm(100,0,1)
  y = exp(10 * x + noise) / (1 + exp(10 * x + noise))
  
  data &lt;- list( x= x, y = y, N = length(x))
  </code></pre>
  <p>In <code>stan</code>, I am creating below <code>stan</code> object</p>
  <pre><code>Model = &quot;
  data {
    int&lt;lower=0&gt; N;
    vector[N] x;
    vector[N] y;
  }
  parameters {
    real alpha;
    real beta;
    real&lt;lower=0&gt; sigma;
  }
  transformed parameters {
      vector[N] mu;
      for (f in 1:N) {
          mu[f] = alpha + beta * x[f];
      }
  }
  
  model {
    sigma ~ chi_square(5);
    alpha ~ normal(0, 1);
    beta ~ normal(0, 1);
    y ~ ???;
  }
  &quot;
  </code></pre>
  <p>However as you can see, what will be the right <code>stan</code> continuous distribution in the <code>model block</code> for <code>y</code>?</p>
  <p>Any pointer will be highly appreciated.</p>
  <p>Thanks for your time.</p>