Statisticians: _propto vs _unnormalized (vs ?)

A day later, I’m coming back to this and this makes a lot more sense than any of the other options. (Well, this or just having a global flag).

I still think it’s worth looking into if the corrections for bounded parameters can be done automatically (although this will be a breaking change[!!!], it would be much more user-friendly logic than the current system)

Hmm, to make the function names shorter and incorporate @anon75146577’s propto keyword idea (and the notion that you’d probably want to apply this keyword to several items at once), we could use the proposed annotation system, which might look something like this:

@propto {
  target += normal_lpdf(mu, sigma);
  target += poisson_lpdf(lambda);
}

@propto y ~ normal(mu2, sigma2);
y2 ~ normal(mu3, sigma3);

In this example, all the distributions except y2 ~ normal(mu3, sigma3) would be proportional up to a constant factor. The first use of @propto is annotating the entire block of code enclosed in the {}.

I think this would have been a good way to design the language initially, and maybe we can go with that for Stan 3 where we’d be allowed to make backwards-incompatible changes, but I think for Stan 2 we couldn’t do that because it would change existing models.

Is there anything worth doing in Stan 2 (that is backwards compatible)? The answer here might just be “no, it’s not that urgent and we’d rather just do it right later.”

1 Like

I like this one

2 Likes