Open simoncolumbus opened 1 year ago
Not sure who would be the best person to tag here but I think this issue deserves some attention given that normal_lccdf
is quite a relevant function. If it turns out to indeed be a bug in that function, we should aim to fix it sooner rather than later. @wds15 would you mind checking or do you have a suggestion for who to tag here?
This is probably a duplicate of #1985 .
Yes, indeed, thank you!
@paul-buerkner I think @nhuurre is on the spot. The cdf & ccdf's are not great in their precision and looking through the history of things here it's unfortunate that this has not yet been resolved. For brms
one could try to solve the matter by resorting to normal_lcdf
and sign-flipping the mean possibly? This obviously needs to be solve in Stan-math eventually...but rstan is still so much behind such that most R users would love the workaround...
I agree. Not sure, how a workaround would look like in brms though, given brms strict naming conventions on functions and our inability to locally overwrite built-in with custom functions (I think?)
Not sure either. You can't overload a built in function, no. You'd need to rename this. Maybe normalcens_lccdf
will be the distribution and then you can create a user function handling this.
I've been running into issues fitting models with a right-censored normal distribution, using
brms
. I've submitted an issue withbrms
here: https://github.com/paul-buerkner/brms/issues/1423 However, it appears that the error does not arise frombrms
. @paul-buerkner suggested it might instead arise from a bug innormal_lccdf
, so I thought I'd post it here.I appears that the issue occurs only
gaussian
family; others such asstudent
orweibull
work fine;normal_lccdf
as the culprit);Below is my original post to the brms issue tracker, containing a MWE. Apologies for not testing this with other Stan interfaces.
This occurs across multiple datasets and different kinds of models (linear mixed model with one random factor; mixed-effects location scale model), and when init = 0.
Stan code for this model (generated with brms 2.17.0):
In contrast, left-censoring works:
I tested this on two machines.