ABC {AVGAS}R Documentation

Evaluating ABC for each fitted model

Description

This function evaluates ABC score for fitted model, one model at a time. For a model I, the ABC is defined as

ABC(I)=\sum\limits_{i=1}^n\bigg(Y_i-\hat{Y}_i^{I}\bigg)^2+2r_I\sigma^2+\lambda\sigma^2C_I.

When comparing ABC of fitted models to the same data set, the smaller the ABC, the better fit.

Usage

ABC(
  X,
  y,
  heredity = "Strong",
  nmain.p,
  sigma = NULL,
  extract = "No",
  varind = NULL,
  interaction.ind = NULL,
  pi1 = 0.32,
  pi2 = 0.32,
  pi3 = 0.32,
  lambda = 10
)

Arguments

X

Input data. An optional data frame, or numeric matrix of dimension n by nmain.p. Note that the two-way interaction effects should not be included in X because this function automatically generates the corresponding two-way interaction effects if needed.

y

Response variable. A n-dimensional vector, where n is the number of observations in X.

heredity

Whether to enforce Strong, Weak, or No heredity. Default is "Strong".

nmain.p

A numeric value that represents the total number of main effects in X.

sigma

The standard deviation of the noise term. In practice, sigma is usually unknown. In such case, this function automatically estimate sigma using root mean square error (RMSE). Default is NULL. Otherwise, users need to enter a numeric value.

extract

A either "Yes" or "No" logical vector that represents whether or not to extract specific columns from X. Default is "No".

varind

Only used when extract = "Yes". A numeric vector of class c() that specifies the indices of variables to be extracted from X. If varind contains indices of two-way interaction effects, then this function automatically generates corresponding two-way interaction effects from X.

interaction.ind

Only used when extract = "Yes". A two-column numeric matrix containing all possible two-way interaction effects. It must be generated outside of this function using t(utils::combn()) or indchunked(). See Example section for details.

pi1

A numeric value between 0 and 1, defined by users. Default is 0.32. For guidance on selecting an appropriate value, please refer to the Details section.

pi2

A numeric value between 0 and 1, defined by users. Default is 0.32. For guidance on selecting an appropriate value, please refer to the Details section.

pi3

A numeric value between 0 and 1, defined by users. Default is 0.32. For guidance on selecting an appropriate value, please refer to the Details section.

lambda

A numeric value defined by users. Default is 10. For guidance on selecting an appropriate value, please refer to the Details section.

Details

Value

A numeric value is returned. It represents the ABC score of the fitted model.

References

Ye, C. and Yang, Y., 2019. High-dimensional adaptive minimax sparse estimation with interactions.

See Also

Extract, initial.

Examples

# sigma is unknown
set.seed(0)
nmain.p <- 4
interaction.ind <- t(combn(4,2))
X <- matrix(rnorm(50*4,1,0.1), 50, 4)
epl <- rnorm(50,0,0.01)
y<- 1+X[,1]+X[,2]+X[,3]+X[,4]+epl
ABC(X, y, nmain.p = 4, interaction.ind = interaction.ind)
ABC(X, y, nmain.p = 4, extract = "Yes",
    varind = c(1,2,5), interaction.ind = interaction.ind)
#'
# users want to enter a suggested value for sigma

# model with only one predictor
try(ABC(X, y, nmain.p = 4, extract = "Yes",
  varind = 1, interaction.ind = interaction.ind)) # warning message

[Package AVGAS version 0.1.0 Index]