Version 0.6-6
The genridge package introduces generalizations of the standard univariate ridge trace plot used in ridge regression and related methods (Friendly, 2013) These graphical methods show both bias (actually, shrinkage) and precision, by plotting the covariance ellipsoids of the estimated coefficients, rather than just the estimates themselves. 2D and 3D plotting methods are provided, both in the space of the predictor variables and in the transformed space of the PCA/SVD of the predictors.
This package provides computational support for the graphical methods described in Friendly (2013). Ridge regression models may be fit using the function ridge
, which incorporates features of MASS::lm.ridge
and ElemStatLearn::simple.ridge
. In particular, the shrinkage factors in ridge regression may be specified either in terms of the constant (
More importantly, the ridge
function also calculates and returns the associated covariance matrices of each of the ridge estimates, allowing precision to be studied and displayed graphically.
This provides the support for the main plotting functions in the package:
-
plot.ridge
: Bivariate ridge trace plots -
pairs.ridge
: All pairwise bivariate ridge trace plots -
plot3d.ridge
: 3D ridge trace plots -
traceplot
: Traditional univariate ridge trace plots
In addition, the function pca.ridge transforms the coefficients and covariance matrices of a ridge object from predictor space to the equivalent, but more interesting space of the PCA of c("ridge", "pcaridge")
.
Finally, the functions precision
and vif.ridge
provide other useful measures and plots.
Get the released version from CRAN:
install.packages("genridge")
The development version can be installed to your R library directly from this repo via:
if (!require(devtools)) install.packages("devtools")
library(devtools)
install_github("friendly/genridge")
Friendly, M. (2013). The Generalized Ridge Trace Plot: Visualizing Bias and Precision. Journal of Computational and Graphical Statistics, 22(1), 50-68, doi link, Preprint: genridge.pdf