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
|
y |
Response variable. A |
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 |
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 |
varind |
Only used when |
interaction.ind |
Only used when |
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
For inputs
pi1
,pi2
, andpi3
, the number needs to satisfy the condition:\pi_1+\pi_2+\pi_3=1-\pi_0
where\pi_0
is a numeric value between 0 and 1, the smaller the better.For input
lambda
, the number needs to satisfy the condition:\lambda\geq 5.1/log(2)
.
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
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