Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements censored families. For example
where
time
is a survival time andstatus
is either"right"
or"none"
indicating right-censoring and no censoring, repsectively.But there's an additional feature I discuss below
In addition,
bmb.Model
gains an extra argument calledcenter_predictors
. By default, when there's an intercept, Bambi centers all the predictors in the design matrix. This usually results in better sampling speed because (if I'm correct) mitigates some correlation in the posterior.However, while I was testing the new censored models I was having lots of sampling initialization problems. I think it was due to a combination of the prior choice and the scale of the predictor variable, that when centered, caused the issue. So by doing
bmb.Model(..., center_predictors=False)
we get rid of the centering and the problem disappears.Notice the
center_predictors=False
may also be usefu.l to people that just want to make sure the intercept they select for the prior has the natural interpretation they expect. With automatic centering, the interpretation of the intercept is not what you think it is (unless all your predictors are centered around zero)