Fit a bridge-penalized least-squares path using local quadratic approximation.
Usage
bridge(
X,
y,
q = 1,
lambda.min = ifelse(n > p, 0.001, 0.05),
nlambda = 100,
lambda,
eta = 1e-07,
converge = 10^10
)Arguments
- X
Numeric design matrix with
nobservation rows andppredictor columns. Supply finite values and predictors with nonzero variation; omit an intercept column. A data frame is converted usingmodel.matrix(~0+., X); restrictions and future predictions must use the resulting predictor order.- y
Numeric response vector of length
n, containing finite values.- q
Bridge-penalty exponent, a finite number in
(0, 2]. Values 1 and 2 specify the L1 and L2 penalty forms. Estimation uses local quadratic approximation (LQA).- lambda.min
Positive absolute endpoint of the automatically generated penalty grid. The default is
0.001whenn > p, and0.05otherwise. This argument is a penalty value, not a ratio. In CV results, the field also namedlambda.mininstead denotes the selected penalty.- nlambda
Number of automatically generated penalty values, an integer of at least 2. The default is
100; ignored whenlambdais supplied.- lambda
Optional nonempty numeric vector of finite, nonnegative penalty values. Its order is retained. When supplied, it determines the fitted path and overrides
nlambdaand the grid argumentlambda.min.- eta
Positive numerical tolerance, with default
1e-7. Used for coefficient elimination and stopping on squared coefficient changes.- converge
Nonnegative initial convergence-distance value, retained for compatibility. The default is
1e10. Iteration stops when the updated squared coefficient change is at mosteta, or at the historical cap.
Value
A list of class bridge with components:
- betas
Numeric coefficient matrix with
p + 1rows andlength(lambda)columns, one column per fitted penalty. The first row is(Intercept); the remaining rows are original-scale slopes in predictor order. Column names identify the fitted penalties.- lambda
Numeric vector of penalties, in fitted column order.
Details
Predictors are centered and divided by their centered root-mean-square
(RMS) deviations, using the observation count n as the divisor.
The response is centered. The intercept is reconstructed after fitting,
and returned coefficients are expressed on the original predictor scale.
The generated penalties are logarithmically spaced between an internally
computed starting value and the absolute endpoint lambda.min.
Let be the by centered, RMS-standardized design, the centered response vector of length , and the -dimensional standardized slope vector. For exponent and penalty weight , Equation (1) defines the penalized least-squares target: In Equation (1), is the squared Euclidean norm, so its first term is the unnormalized residual sum of squares. The index runs over the predictors; the second term is the bridge penalty, with controlling its weight relative to residual error.
The fitting routine applies the article's LQA updates, coefficient elimination and stopping rules. The criterion is nonconvex when , so the iterative result is not a guarantee of a global minimum. The getting-started vignette explains the penalty geometry and the fixed-LQA restriction correction.
References
Yuzbasi, B., Arashi, M. and Akdeniz, F. (2021). Penalized regression via the restricted bridge estimator. Soft Computing, 25, 8401–8416. doi:10.1007/s00500-021-05763-9 .
Author
Bahadir Yuzbasi
Maintainer: Bahadir Yuzbasi b.yzb@hotmail.com
Examples
# Reproducible synthetic demonstration: 100 observations, eight predictors.
set.seed(2019)
beta <- c(3, 1.5, 0, 0, 2, 0, 0, 0)
p <- length(beta)
beta <- matrix(beta, nrow = p, ncol = 1)
n <- 100
X <- matrix(rnorm(n * p), nrow = n, ncol = p)
y <- as.numeric(X %*% beta + rnorm(n))
# Five penalties keep this help example fast; the default is 100.
# L1 and L2 penalty forms on the same observations.
model1 <- bridge(X, y, q = 1, nlambda = 5)
model2 <- bridge(X, y, q = 2, nlambda = 5)
dim(model1$betas)
#> [1] 9 5
# Extract one fitted column and predict five observations.
selected <- model1$lambda[2]
coef(model1, s = selected)
#> 26.8035044402758
#> (Intercept) -3.121540e-02
#> V1 2.848999e+00
#> V2 1.433841e+00
#> V3 1.282147e-04
#> V4 -1.150407e-05
#> V5 1.879705e+00
#> V6 -1.064341e-04
#> V7 8.497907e-08
#> V8 -1.609602e-05
predict(model1, newx = X[1:5, , drop = FALSE], s = selected)
#> [1] -1.5002196 0.2180873 -1.5417858 2.4731030 -9.8607011