Description Usage Arguments Value Author(s) References Examples
Function to calculate the S-Ridge estimator of Maronna (2011), adapted from Maronna's original MATLAB code. It is not intended to be used on its own, but rather as an initial estimator for the MM-Lasso.
1 2 | sridge(x,y,cualcv.S=5,numlam.S=30,niter.S=50,normin=0,
denormout=0,alone=0,ncores=1)
|
x |
A matrix of carriers. Intercept is added automatically. |
y |
A vector of response variables. |
cualcv.S |
A natural number greater than 2. Method for estimating prediction error of S-Ridge: cualcv-fold cross validation. Default is 5. |
numlam.S |
Number of candidate penalization parameter values for S-Ridge. Default is 30. |
niter.S |
Maximum number of iterations of IWLS for S-Ridge. Default is 50. |
normin |
Center and scale input data? 0=no, default ; 1=yes. |
denormout |
Return final estimate in the original coordinates? 0=no, default ; 1=yes. |
alone |
Are you calculating the estimator for its sake only? 0=no, default ; 1=yes. |
ncores |
Number of cores to use for parallel computations. Default is one core. |
coef |
S-Ridge estimate. First coordinate is the intercept. |
scale |
M-estimate of scale of the residuals of the final regression estimate. |
edf |
Final equivalent degrees of freedom. |
lamda |
Optimal lambda. |
delta |
Optimal delta. |
Ezequiel Smucler, ezequiels.90@gmail.com.
Ricardo Maronna.
Ezequiel Smucler and Victor J. Yohai. Robust and sparse estimators for linear regression models (2015). Available at http://arxiv.org/abs/1508.01967.
Maronna, R.A. (2011). Robust Ridge Regression for High-Dimensional Data. Technometrics 53 44-53.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | require(MASS)
p <- 8
n <- 60
rho <- 0.5
desv <- 1
beta.true <- c(rep(0,p+1))
beta.true[2] <- 3
beta.true[3] <- 1.5
beta.true[7] <- 2
mu <- rep(0,p)
sigma <- rho^t(sapply(1:p, function(i, j) abs(i-j), 1:p))
set.seed(1234)
x <- mvrnorm(n,mu,sigma)
u <- rnorm(n)*desv
y <- x%*%beta.true[2:(p+1)]+beta.true[1]+u
###Calculate estimators
set.seed(1234)
SRidge <- sridge(x,y,normin=1,denormout=1,alone=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.