Description
Description
Our probability-distribution functions come in familes, e.g., normal_X()
, where X
can be any of
lpdf
, lupdf
, cdf
, lcdf
, lccdf
, rng
. But not all probability distributions implement each expected probability function. When a user calls foo_X
for a probability distribution foo
that exists, but foo_X
doesn't exist, we should have a more specific message informing them of that so they don't think they've made a typo or waste time looking in the doc.
Motivation
Quoted from @betanalpha's comment stan-dev/design-docs#42 (comment):
Most of the probability libraries in R, Python, Mathematica, etc have a pretty uniform coverage of the exposed representations. One you know the name of a family of distributions you know how to call the corresponding density, CDF, quantile function, rng, etc. At the point the coverage in Stan is pretty uniform, but it’s becoming less and less uniform as more obscure families are added without all of the functionality. If a user is assuming that everything will be uniformly available but gets an error message then can become frustrating assuming that there’s a spelling error or other typo somewhere and not just a non-implemented functionality.
It would be great to add functionality to the compiler to fill in these gaps so that if a user calls for some functionality that has not yet been implemented then they get a precise error message noting that gap and not the default error message noting the the function being requested just doesn’t exist.