Description
This is an issue which have been discussed multiple times before, but generally as part of other issues / PRs rather than as its own issue.
The question is mainly: should we provide some convenience macros for users that can be used within @model
to achieve different behaviors?
More specifically, I have the following macros in mind (with names ofc being up for discussion) to start with:
@isobservation(x)
: returnstrue
if the variablex
is considered an observation according to the model. Ref: Supporting mutating ADs in models that fill arrays of parameters #412@observed_value(x)
: returns the observed value forx
(assuming it's indeed observed). Ref: Supporting mutating ADs in models that fill arrays of parameters #412
Others that we might also want to consider, but these I think require more thought:
@is_post_inference
: indicates whether we're performing "post-inference" analysis rather than performing inference (or something else). Ref: Should we have a context to indicate that we're not performing inference? #510 .
I bring this up now because the argument against this has always been "we don't want to have too many macros", but in #696 , we're introducing @prefix
(in addition to @returned_quantities
, but this is meant to replace @submodel
) and seem to be embracing macros quite a bit more? Hence it seems like a useful moment to re-raise the issue.