Option to keep constant terms in log probability via standard sampling syntax?

Thanks, Rok! Good to know, both re _lupdf() and the update to size().

The net syntax is still significantly more cumbersome, though; that was part of the reason for my request. For example,

parameters {
    vector<lower=LOWER, upper=UPPER>[N] y;
}
model {
    y ~ normal(MU, SIGMA);  // drop constants
}

versus

parameters {
    vector<lower=LOWER, upper=UPPER>[N] y;
}
model {
    target +=
        normal_lpdf(y | MU, SIGMA) -  // don't drop constants
        N * log_diff_exp(  // adjust each for truncation
            normal_lcdf(UPPER | MU, SIGMA),
            normal_lcdf(LOWER | MU, SIGMA)
        );
}

With a dozen or so of those, the potential for error increases (and the user-friendliness decreases).

1 Like