ridge | R Documentation |
Fit a linear model by ridge regression, returning an object of class "ridge"
.
ridge(formula, data, subset, lambda = 1.0, method = "GCV", ngrid = 200, tol = 1e-07,
maxiter = 50, na.action, x = FALSE, y = FALSE, contrasts = NULL, ...)
formula |
an object of class |
data |
an optional data frame, list or environment (or object coercible
by |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
na.action |
a function which indicates what should happen when the data
contain |
lambda |
a scalar or vector of ridge constants. A value of 0 corresponds to ordinary least squares. |
method |
the method for choosing the ridge parameter lambda. If |
ngrid |
number of elements in the grid used to compute the GCV criterion.
Only required if |
tol |
tolerance for the optimization of the GCV criterion. Default is |
maxiter |
maximum number of iterations. The default is 50. |
x , y |
logicals. If |
contrasts |
an optional list. See the |
... |
additional arguments to be passed to the low level regression fitting functions (not implemented). |
ridge
function fits in linear ridge regression without scaling or centering
the regressors and the response. In addition, If an intercept is present in the model, its
coefficient is penalized.)
A list with the following components:
dims |
dimensions of model matrix. |
coefficients |
a named vector of coefficients. |
scale |
a named vector of coefficients. |
fitted.values |
the fitted mean values. |
residuals |
the residuals, that is response minus fitted values. |
RSS |
the residual sum of squares. |
edf |
the effective number of parameters. |
GCV |
vector (if |
HKB |
HKB estimate of the ridge constant. |
LW |
LW estimate of the ridge constant. |
lambda |
vector (if |
optimal |
value of lambda with the minimum GCV (only relevant if |
iterations |
number of iterations performed by the algorithm (only relevant if |
call |
the matched call. |
terms |
the |
contrasts |
(only where relevant) the contrasts used. |
y |
if requested, the response used. |
x |
if requested, the model matrix used. |
model |
if requested, the model frame used. |
Golub, G.H., Heath, M., Wahba, G. (1979). Generalized cross-validation as a method for choosing a good ridge parameter. Technometrics 21, 215-223.
Hoerl, A.E., Kennard, R.W., Baldwin, K.F. (1975). Ridge regression: Some simulations. Communication in Statistics 4, 105-123.
Hoerl, A.E., Kennard, R.W. (1970). Ridge regression: Biased estimation of nonorthogonal problems. Technometrics 12, 55-67.
Lawless, J.F., Wang, P. (1976). A simulation study of ridge and other regression estimators. Communications in Statistics 5, 307-323.
Lee, T.S (1987). Algorithm AS 223: Optimum ridge parameter selection. Applied Statistics 36, 112-118.
lm
, ols
z <- ridge(GNP.deflator ~ ., data = longley, lambda = 4, method = "grid")
z # ridge regression on a grid over seq(0, 4, length = 200)
z <- ridge(GNP.deflator ~ ., data = longley)
z # ridge parameter selected using GCV (default)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.