@@ -531,8 +531,10 @@ large as necessary.
531531In some situations, such as pure forward data simulation in a directed
532532graphical model (e.g., where you can work down generatively from known
533533hyperpriors to simulate parameters and data), there is no need to
534- declare any parameters in Stan, the model block will be empty, and all
535- output quantities will be produced in the generated quantities block.
534+ declare any parameters in Stan, the model block will be empty (and thus
535+ can be omitted), and all output quantities will be produced in the
536+ generated quantities block.
537+
536538For example, to generate a sequence of $N$ draws from a binomial with
537539trials $K$ and chance of success $\theta$, the following program suffices.
538540
@@ -542,20 +544,16 @@ data {
542544 int<lower=0> K;
543545 int<lower=0> N;
544546}
545- model {
546- }
547547generated quantities {
548548 int<lower=0,upper=K> y[N];
549549 for (n in 1:N)
550550 y[n] = binomial_rng(K, theta);
551551}
552552```
553553
554- This program includes an empty model block because every Stan program
555- must have a model block, even if it's empty. For this model, the
556- sampler must be configured to use the fixed-parameters setting because
557- there are no parameters. Without parameter sampling there is no need
558- for adaptation and the number of warmup iterations should be set to
554+ For this model, the sampler must be configured to use the fixed-parameters
555+ setting because there are no parameters. Without parameter sampling there
556+ is no need for adaptation and the number of warmup iterations should be set to
559557zero.
560558
561559Most models that are written to be sampled without parameters will not
0 commit comments