Categories &

Functions List

Function Reference: gamboostpairs

statistics: S = gamboostpairs (X, R)

Score every pair of predictors for an interaction.

S = gamboostpairs (X, R) lays the residuals R of a fitted additive model on the coarse grid of each pair of columns of X and returns the two-way analysis of variance F ratio testing what only the cells explain. It is used to rank candidate interactions for ClassificationGAM and RegressionGAM, and it is not meant to be called directly.

The p-values are deliberately not computed here. Turning F into a probability needs fcdf, which the package already ships and which is verified against MATLAB, so the caller applies it rather than a second implementation being carried in the compiled engine. Which pairs to keep is policy and belongs beside that.

  • X is an NxP numeric matrix of predictors, and P must be at least 2 for any pair to exist.
  • R is the Nx1 residual vector of the additive fit.

S is a structure with the following fields, one row per pair, ordered as nchoosek orders them.

  • Pairs, the Mx2 matrix of predictor index pairs.
  • F, the Mx1 vector of F ratios. A pair with too few observations, no spare degrees of freedom or no within-cell scatter scores 0.
  • DF1 and DF2, the Mx1 numerator and denominator degrees of freedom.
  • BinEdges, a 1xP cell of the coarse cut points each predictor was laid on. The grid is fixed at eight equal-frequency bins, which is what MATLAB reports for pair detection at every sample size.

See also: gamboosttrain, gamboostpredict, fcdf, ClassificationGAM

Source Code: gamboostpairs