Learn R Programming

genridge (version 0.6-3)

biplot.pcaridge: Biplot of Ridge Regression Trace Plot in SVD Space

Description

biplot.pcaridge supplements the standard display of the covariance ellipsoids for a ridge regression problem in PCA/SVD space with labeled arrows showing the contributions of the original variables to the dimensions plotted. The biplot view showing the dimensions corresponding to the two smallest singular values is particularly useful for understanding how the predictors contribute to shrinkage in ridge regression. This is only a biplot in the loose sense that results are shown in two spaces simultaneously -- the transformed PCA/SVD space of the original predictors, and vectors representing the predictors projected into this space. biplot.ridge is a similar extension of plot.ridge, adding vectors showing the relation of the PCA/SVD dimensions to the plotted variables.

Usage

## S3 method for class 'pcaridge':
biplot(x, variables = (p - 1):p, labels=NULL, asp = 1, 
	origin, scale, 
	var.lab = rownames(V), var.lwd = 1, var.col = "black", var.cex = 1, 
	xlab, ylab, prefix = "Dim ", suffix = TRUE, ...)

## S3 method for class 'ridge':
biplot(x, variables = 1:2, xlab, ylab, ...)

Arguments

Value

None

Details

class("ridge") objects use the transpose of the right singular vectors, t(x$svd.V) for the dimension weights plotted as vectors.

References

Friendly, M. (2012). The Generalized Ridge Trace Plot: Visualizing Bias and Precision. In press, Journal of Computational and Graphical Statistics, 21.

See Also

plot.ridge, pca.ridge

Examples

Run this code
longley.y <- longley[, "Employed"]
longley.X <- data.matrix(longley[, c(2:6,1)])

lambda <- c(0, 0.005, 0.01, 0.02, 0.04, 0.08)
lridge <- ridge(longley.y, longley.X, lambda=lambda)

plridge <- pca.ridge(lridge)

plot(plridge, radius=0.5)

# same, with variable vectors
biplot(plridge, radius=0.5)
# add some other options
biplot(plridge, radius=0.5, var.col="brown", var.lwd=2, var.cex=1.2, prefix="Dimension ")

# biplots for ridge objects, showing PCA vectors
plot(lridge, radius=0.5)
biplot(lridge, radius=0.5)
biplot(lridge, radius=0.5, asp=NA)

Run the code above in your browser using DataLab