Learn R Programming

RXshrink (version 2.0)

RXshrink-package: Maximum Likelihood (ML) Shrinkage using Generalized Ridge or Least Angle Regression

Description

The functions in this package augment basic calculations of Generalized Ridge and Least Angle Regression with Visual Insights using five types of ridge TRACE display: [1] regression coefficients, [2] relative MSE risk, [3] excess eigenvalues, [4] inferior direction cosines, and [5] shrinkage delta-factors. TRACEs completely characterize the primary Effects of Shrinkage along ridge Paths with 2 or more parameters: either m-Extent plus q-Shape of Shrinkage or the Efficient PATH with as many parameters, p, as non-constant X-predictor variables. All Paths start at the Ordinary Least-Squares estimate [m = 0] and end at the origin, (0, 0, ..., 0), where all coefficient estimates have been shrunken to zero [m = p = rank(X).] Three different types of Likelihood of minimal MSE risk (Classical Normal-Theory, Empirical Bayes, and Random Coefficients) can be monitored to suggest an optimal m-Extent of shrinkage for the given matrix of x-Variables and the observed y-Outcome vector.

Arguments

Details

Package: RXshrink
Type: Package
Version: 2.0
Date: 2021-04-02
License: GNU GENERAL PUBLIC LICENSE, Version 2, June 1991

The eff.ridge() function calculates generalized ridge TRACE statistics for the Efficient Shrinkage PATH with p > 1 parameters. This PATH always passes through the Beta coefficient point-estimate that is most likely to achieve optimal MSE risk reductions under Normal distribution-theory. This PATH is as Short as Possible; it consists of a Two-Piece Linear-Spline with its single "interior" KNOT at the MSE Risk Optimal m-Extent of Shrinkage.

MLboot(), MLcalc() and MLhist() support use of Bootstrap resampling to study the bias and MSE risk characeristics of non-linear (unrestricted) Generalized Ridge Regression (GRR) estimators.

When true regression parameters have user-specified (KNOWN) numerical values, MLtrue() uses this information and generates a new data.frame that contains a y-Outcome vector of the expected form with "disturbance" terms that are I.I.D. Normal errors-in-measurement. Arguments to MLtrue() must include the "formula" for a desired linear model and a data.frame containing the specified X-variables.

qm.ridge() calculates and displays TRACEs for traditional PATHs defined by just 2-parameters: q-Shape and m-Extent of Shrinkage. By default, the search for the Path with most likely q-Shape uses a lattice of only 21 values within [-5,+5]. However, lattice searches for both q-Shape and m-Extent are easy to modify using the qmax, qmin, nq and steps arguments to qm.ridge(). The "ordinary" ridge Path of Hoerl and Kennard always uses q-Shape = 0, while "uniform" shrinkage corresponds to q-Shape = +1. NONE of these qm-Paths generally achieve Overall Minimum MSE Risk when p > 2 because they restrict attention to "monotome" (increasing or decreasing) "delta" shrinkage-factors.

aug.lars() augments the Efron-Hastie lars() R-function to perform Least Angle Regression with MSE risk calculations and Maximum Likelihood TRACE displays ...like those of eff.ridge() and qm.ridge().

uc.lars() applies Least Angle Regression methods to the Uncorrelated Components of a possibly ill-conditioned set of x-Variables. Calculations use a closed-form expression for lars/lasso shrinkage delta-factors that apply because NO Ill-Conditioning is present in these "uc" cases.

correct.signs() displays the Normal-theory maximum likelihood estimate of the regression coefficient vector that minimizes MSE Risk in the UNKNOWN direction of p-space PARALLEL to the true Beta vector. This estimate corrects "wrong-sign" problems in the sense that its coefficients have the same relative magnitudes and numerical signs as those of the "Correlation Form" of the X'y vector.

YonX() displays Shrinkage statistics and graphics for "simple" linear regression (p = 1) models.

RXpredict() makes predictions (i.e. computes "fitted.values") for 6 types of RXshrink estimation ...either at a user-specified m-Extent of Shrinkage or at the Normal-theory "minMSE" m-Extent.

The unr.ridge() function is currently Deprecated because it uses a somewhat longer and more-complicated shrinkage-PATH than eff.ridge().

References

Efron B, Hastie T, Johnstone I, Tibshirani R. (2003) Least angle regression. Annals of Statistics 32, 407-499.

Goldstein M, Smith AFM. (1974) Ridge-type estimators for regression analysis. J. Roy. Stat. Soc. B 36, 284-291. (The 2-parameter shrinkage family.)

Obenchain RL. (1975) Ridge Analysis Following a Preliminary Test of the Shrunken Hypothesis. Technometrics 17, 431-441. <doi:10.1080/00401706.1975.10489369>

Obenchain RL. (1978) Good and Optimal Ridge Estimators. Annals of Statistics 6, 1111-1121. <doi:10.1214/aos/1176344314>

Obenchain RL. (2021) The Efficient Shrinkage Path: Maximum Likelihood of Minimum MSE Risk. https://arxiv.org/abs/2103.05161

Obenchain RL. (2021) RXshrink_in_R.PDF RXshrink package vignette-like document, Version 2.0. http://localcontrolstatistics.org

Examples

Run this code
# NOT RUN {
  demo(longley2)
# }

Run the code above in your browser using DataLab