mseRidge {eshrink} | R Documentation |
Compute MSE, Bias, and Variance for Ridge Estimator
Description
Computes the analytic mean-squared error (MSE), bias, and
variance for ridge regression estimators given different
values of the true beta
and sigma2
parameters.
Usage
mseRidge(lambda, XtX, beta, sigma2, penalize, ind = 1, XtXlamIinv = NULL)
biasRidge(lambda, XtX, beta, penalize, ind = 1, XtXlamIinv = NULL)
varRidge(lambda, XtX, sigma2 = 1, penalize, ind = 1, XtXlamIinv = NULL)
Arguments
lambda |
penalty parameter value. For |
XtX |
Cross product of design matrix. Not needed if |
beta |
True parameter values. Either a vector of length |
sigma2 |
Value of the variance parameter |
penalize |
Vector of penalty factors. See |
ind |
Numerical or logical vector indicating which elements of the bias vector and variance matrix should be returned. Defaults to the first element. |
XtXlamIinv |
Optional explicit value of |
Details
The computations assume that all covariates are correctly included in the mean model and bias is due only to penalization. The bias is given by:
-(X'X + \Lambda)^{-1}\Lambda\beta
where \Lambda = diag(\lambda*penalize)
. The variance is given by:
\sigma^2(X'X + \Lambda)^{-1}X'X(X'X + \Lambda)^{-1}
If beta
is provided as a matrix, this will treat
each column of beta
as a different true parameter vector
and return a matrix of bias values (or a vector, if ind
has length 1).
Providing a pre-computed value of XtXlamIinv
can reduce the computational
cost in simulations. However, the user is responsible for assuring that the value
of lambda
provided matches the value used to compute XtXlamIinv
.
Value
For mseRidge
, a list containing the variance, bias, and MSE. For biasRidge
and varRidge
, a matrix is returned.
Author(s)
Joshua Keller