Learn R Programming

genridge (version 0.6-3)

traceplot: Univariate ridge trace plots

Description

The traceplot function extends and simplifies the univariate ridge trace plots for ridge regresssion provided in the plot method for lm.ridge

Usage

traceplot(x, X = c("lambda", "df"), 
   col = c("black", "red", "darkgreen", "blue", "darkcyan", "magenta", "brown", "darkgray"), 
   pch = c(15:18, 7, 9, 12, 13), xlab, ylab = "Coefficient", xlim, ylim, ...)

Arguments

Value

None. Used for its side effect of plotting.

Details

For ease of interpretation, the variables are labeled at the side of the plot (left, right) where the coefficient estimates are expected to be most widely spread. If xlim is not specified, the range of the X variable is extended slightly to accommodate the variable names.

References

Friendly, M. (2012). The Generalized Ridge Trace Plot: Visualizing Bias and Precision. In press, Journal of Computational and Graphical Statistics, 21. Hoerl, A. E. and Kennard R. W. (1970). "Ridge Regression: Applications to Nonorthogonal Problems", Technometrics, 12(1), 69-82.

See Also

ridge for details on ridge regression as implemented here plot.ridge, pairs.ridge for other plotting methods

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)

traceplot(lridge)
#abline(v=lridge$kLW, lty=3)
#abline(v=lridge$kHKB, lty=3)
#text(lridge$kLW, -3, "LW")
#text(lridge$kHKB, -3, "HKB")

traceplot(lridge, X="df")

Run the code above in your browser using DataLab