Learn R Programming

genridge (version 0.6-3)

plot3d.ridge: 3D Ridge Trace Plots

Description

The 3D ridge trace plot displays 3D projections of the covariance ellipsoids for a set of ridge regression estimates indexed by a ridge tuning constant. The centers of these ellipses show the bias induced for each parameter, and also how the change in the ridge estimate for one parameter is related to changes for other parameters. The size and shapes of the covariance ellipsoids show directly the effect on precision of the estimates as a function of the ridge tuning constant.

Usage

plot3d(x, ...)

## S3 method for class 'ridge':
plot3d(x, variables = 1:3, radius = 1,  which.lambda=1:length(x$lambda),
	lwd = 1, lty = 1, 
	xlim, ylim, zlim, 
	xlab, ylab, zlab, 
	col = c("black", "red", "darkgreen", "blue", "darkcyan", "magenta", "brown", "darkgray"), 
	labels = lambda, 
	ref = TRUE, ref.col = gray(0.7), 
	segments = 40, shade = TRUE, shade.alpha = 0.1, 
	wire = FALSE, aspect=1, add = FALSE, ...)

## S3 method for class 'pcaridge':
plot3d(x, variables = (p-2):p, ...)

Arguments

Value

None

Details

plot3d.ridge and plot3d.pcaridge differ only in the defaults for the variables plotted.

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, pairs.ridge, pca.ridge

Examples

Run this code
lmod <- lm(Employed ~ GNP + Unemployed + Armed.Forces + Population + Year + GNP.deflator, data=longley)
longley.y <- longley[, "Employed"]
longley.X <- model.matrix(lmod)[,-1]

lambda <- c(0, 0.005, 0.01, 0.02, 0.04, 0.08)
lambdaf <- c("0", ".005", ".01", ".02", ".04", ".08")
lridge <- ridge(longley.y, longley.X, lambda=lambda)

plot3d(lridge, var=c(1,4,5), radius=0.5)

# view in SVD/PCA space
plridge <- pca.ridge(lridge)
plot3d(plridge, radius=0.5)

Run the code above in your browser using DataLab