Turns a pre-trained ensemble meta into a deployable goodness-of-fit
test for any fitted model: it scores the model, then calibrates the
p-value by a per-dataset parametric bootstrap from the fitted model (so no
knowledge of the truth or the data-generating design is required). Validity
comes from the bootstrap, independent of how meta was trained.
Arguments
- object
A fitted binary logistic
glm.- meta
A pre-trained scorer: either a function
f(features)returning a scalar misfit score, or an object with apredictmethod consuming a one-row featurematrix.- B
Number of parametric-bootstrap resamples (default 99).
- feature_fn
Function mapping a fitted glm to its feature vector (default
gof.features).