m[N];
  // use current estimate of theta to generate new sample
  for (n in 1:N)
    y_sim[n] = bernoulli_rng(theta);
  // estimate theta_rep from new sample
  theta_rep = sum(y_sim) * 1.0 / N;
}</code></pre>
<p>The rest of the program is the same as in <code>bernoulli.stan</code>.</p>
<p>The <code>generate_method</code> requires the sub-argument <code>fitted_params</code>
which takes as its value the name of a Stan CSV file.
The per-draw parameter estimates from the <code>fitted_params</code> file will
be 