Auction: Internal function to manage multiple experts.

AuctionR Documentation

Internal function to manage multiple experts.

Description

runAuction is the workhorse of the rai package: it takes an initial expert list and runs the Revisiting Alpha-Investing algorithm to greedily fit (optional) polynomials and interactions to data. The term "auction" is the result of multiple experts bidding to perform the test which determines stepwise ordering. This function is not intended to be called directly, but through rai.

Usage

vif(res, y, X, x, n, p, m, TSS, lmFit)

runAuction(
  experts,
  gWealth,
  theData,
  y,
  alg,
  poly,
  searchType,
  m,
  sigma,
  omega,
  reuse,
  nMaxTest,
  verbose,
  save,
  lmFit,
  baseModel
)

Arguments

res

residuals from current model.

y

the response as a single column matrix.

X

covariates in the current model.

x

covariate being tested for addition into the model.

n

number of observations.

p

number of predictors in the current model.

m

number of observations used in subsampling for variance inflation factor estimate of r.squared.

TSS

total sum of squares; considering current residuals to be the response.

lmFit

The core function that will be used to estimate linear model fits. The default is .lm.fit, but other alternatives are possible. Note that it does not use formula notation as this is costly. Another recommended option is fastLmPure from RcppEigen or related packages.

experts

list of expert objects. Each expert is the output of makeStepwiseExpert or makeScavengerExpert.

gWealth

global wealth object, output of gWealthStep.

theData

covariate matrix.

alg

algorithm can be one of "rai", "raiPlus", or "RH" (Revisiting Holm).

poly

logical. Should the algorithm look for higher-order polynomials?

searchType

A character string specifying the prioritization of higher-order polynomials. One of "breadth" (more base features) or "depth" (higher order).

sigma

type of error estimate used in gWealthStep; one of "ind" or "step".

omega

return from rejecting a test in Alpha-Investing.

reuse

logical. Should repeated tests of the same covariate be considered a test of the same hypothesis? Reusing wealth isn't implemented for RAI or RAIplus (effect is negligible).

nMaxTest

maximum number of tests

verbose

logical. Should auction output be printed?

save

logical. Should the auction results be saved? If TRUE, returns a summary matrix.

baseModel

Features to include as the initial model. When NULL, the base model only includes the intercept. baseModel must be specified as a list of desired features. Each list element is a vector of column names or indices, where vectors of length > 1 specify an interaction term of those features. Please check the transformed data using prepareData in order to determine the correct column names and indexes of your desired model.

Value

A list which includes the following components:

formula

final model formula.

y

response.

X

model matrix from final model.

features

list of interactions included in formula.

summary

included if save=TRUE; matrix where each row contains the summary information of a single test.


korydjohnson/rai documentation built on April 21, 2022, 2:59 p.m.