This is an old version, view current version.

20.6 Parameters with multiple twiddles

A warning is generated when a parameter is found on the left-hand side of more than one ~ statements (or an equivalent target += conditional density statement). This pattern is not inherently an issue, but it is unusual and may indicate a mistake.

Pedantic mode only searches for repeated statements, it will not for example generate a warning when a ~ statement is executed repeatedly inside of a loop.

For example, consider the following program.

data {
  real x;
}
parameters {
  real a;
  real b;
}
model {
  a ~ normal(0, 1);
  a ~ normal(x, 1);

  b ~ normal(1, 1);
}

Pedantic mode produces the following warning.

Warning at 'multi-twiddle.stan', line 9, column 2 to column 19:
  The parameter a is on the left-hand side of more than one twiddle
  statement.