mvtb.nonlin(object, Y, X, n.trees = NULL, detect = "grid", scale = TRUE)
mvtb
"grid"
, "influence"
, and "lm"
. See details."influence"
, whether the resulting influences are scaled to sum to 100.$rank.list
, which shows the nonlinear effect for each pair of predictors ranked according to the size of the departure from non-linearity.
The second, $interactions
, shows the departure from non-linearity for all pairs of predictors.
Several methods are provided for detecting departures from non-linearity from pairs of predictors.
The "grid"
method computes a grid of the model implied predictions as a function of two predictors, averaging over the others. A linear model predicting the observed outcomes from the predicted values is fit, and the mean squared residuals (times 1000) are reported. Large residuals indicate deviations from linearity.
The "influence"
method computes the reductions in SSE attributable to predictors after the first split on the tree. These reductions in sums of squared error (or influences) indicate to what extent individual predictors capture deviations from linear, main effects.
The "lm"
method is the same as the "grid"
method, but produces the grid of predicted values by conditioning on the average values of the other predictors rather than averaging over the values of the other predictors (see Elith et al., 2008) . Like the "grid"
approach, large residuals from a linear model (times 1000) indicate departures from linearity.
A final option is to use gbm::interact.gbm
from the gbm
package to detect interactions. It can be used directly on individual mvtb
output models from object$models
.
These methods are not necessarily overlapping, and can produce different results. We suggest using several approaches, followed by plotting the model implied effects of the two predictors.
Elith, J., Leathwick, J. R., & Hastie, T. (2008). A working guide to boosted regression trees. Journal of Animal Ecology, 77(4), 802-813.
Friedman, J. H., & Meulman, J. J. (2003). Multiple additive regression trees with application in epidemiology. Statistics in medicine, 22(9), 1365-1381.
interact.gbm
, mvtb.perspec
, plot.gbm