HiGarrote {HiGarrote} | R Documentation |
An Automatic Method for the Analysis of Experiments using Hierarchical Garrote
Description
'HiGarrote()' provides an automatic method for analyzing experimental data. This function applies the nonnegative garrote method to select important effects while preserving their hierarchical structures. It first estimates regression parameters using generalized ridge regression, where the ridge parameters are derived from a Gaussian process prior placed on the input-output relationship. Subsequently, the initial estimates will be used in the nonnegative garrote for effects selection.
Usage
HiGarrote(
D,
y,
quali_id = NULL,
quanti_id = NULL,
heredity = "weak",
U = NULL,
me_num = NULL,
quali_contr = NULL
)
Arguments
D |
An |
y |
A vector for the responses corresponding to |
quali_id |
A vector indexing qualitative factors. |
quanti_id |
A vector indexing quantitative factors. |
heredity |
Choice of heredity principles: weak or strong. The default is weak. |
U |
Optional. An |
me_num |
Optional. A |
quali_contr |
Optional. A list specifying the contrasts of factors.
|
Value
A vector for the nonnegative garrote estimates of the identified effects.
References
Yu, W. Y. and Joseph, V. R. (2024) "Automated Analysis of Experiments using Hierarchical Garrote," arXiv preprint arXiv:2411.01383.
Examples
# Cast fatigue experiment
data(cast_fatigue)
X <- cast_fatigue[,1:7]
y <- cast_fatigue[,8]
HiGarrote::HiGarrote(X, y)
# Blood glucose experiment
data(blood_glucose)
X <- blood_glucose[,1:8]
y <- blood_glucose[,9]
HiGarrote::HiGarrote(X, y, quanti_id = 2:8)
# Router bit experiment
data(router_bit)
X <- router_bit[, 1:9]
y <- router_bit[,10]
for(i in c(4,5)){
my.contrasts <- matrix(c(-1,-1,1,1,1,-1,-1,1,-1,1,-1,1), ncol = 3)
X[,i] <- as.factor(X[,i])
contrasts(X[,i]) <- my.contrasts
colnames(contrasts(X[,i])) <- paste0(".",1:(4-1))
}
U <- model.matrix(~.^2, X)
U <- U[, -1] # remove the unnecessary intercept terms from the model matrix
me_num = c(rep(1,3), rep(3,2), rep(1, 4))
quali_contr <- list(NULL, NULL, NULL,
matrix(c(-1,-1,1,1,1,-1,-1,1,-1,1,-1,1), ncol = 3),
matrix(c(-1,-1,1,1,1,-1,-1,1,-1,1,-1,1), ncol = 3),
NULL, NULL, NULL, NULL)
HiGarrote::HiGarrote(X, y, quali_id = c(4,5), U = U,
me_num = me_num, quali_contr = quali_contr)
# Experiments with replicates
# Generate simulated data
data(cast_fatigue)
X <- cast_fatigue[,1:7]
U <- data.frame(model.matrix(~.^2, X)[,-1])
error <- matrix(rnorm(24), ncol = 2) # two replicates for each run
y <- 20*U$A + 10*U$A.B + 5*U$A.C + error
HiGarrote::HiGarrote(X, y)