Bugs in Pedantic Mode

Hi, Aki and I were playing around with some simple examples and found things that pedantic mode wasn’t catching. See below.
Andrew

First we created a model with three parameters, two of which had no prior:

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

Pedantic mode returned: “Warning: The parameter c was declared but was not used in the density calculation.”

But what about the parameter b?

Here’s another:

data {
  real y;
}
parameters {
  real a;
  real b;
  real c;
}
model {
  y ~ normal(a + b + c, 1);
}

This time, pedantic returned, “Warning: The parameter c has no priors.
Warning: The parameter b has no priors.”

What happened to a?

1 Like

Bizarre! Thanks for reporting.

Hmm, these examples work fine on my local Stanc3 build. It seems like the interface clipped off the last line of the warnings. Was this CmdStanR?

Edit:
I noticed that the way Stanc3 prints out warnings has some weird formatting that could have caused this. I fixed that, but we should also probably fix this whatever interface you were using.

Will do, thanks!