Hunt by fitting residuals on X.
Arguments
- fit_hunt_method
Function with signature
fit_hunt_method(y, X, ...)that returns a fitted alternative model \(\hat{g} \in \mathcal{G}\). For a fittedg, it must supportpredict_fun_hunt(g, X)for evaluation.- resids
Residuals (i.e., negative scores) of length n from the null model.
- X
Covariates of dim n x p.
- X.cols
Subset of covariates to hunt. (Default:
1:ncol(X))- trim.outlier
If
TRUE, outliers in \(\hat{h}(X)\) will be trimmed from the hunted \(\hat{h}\) using Tukey's IQR rule.- arg.fit_hunt_method
Named list of additional arguments passed to
fit_hunt_method(default toNULL).- predict_fun_hunt
Function with signature
predict_fun_hunt(fit, X)returning a numeric vector of predictions from the alternative-model fit. Defaultstats::predict.
Value
An object of class "hunt", a list with elements:
hunt.fitThe fitted hunt model produced by
fit_hunt_method.trim.boundsThe Tukey IQR trimming bounds, or
c(-Inf, Inf)whentrim.outlier = FALSE.predict_fun_huntThe prediction function for
hunt.fit, as supplied.X.colsThe columns of
Xused for the hunt, as supplied.hA function with signature
h(X)giving the hunted signal.
