source('RRR.R') library(MASS) p <- 8; n <- 100 beta0 <- c(3, 1.5, 0, 0, 2, 0, 0, 0) S <- matrix(0,p,p) for (i in 1:p) for (j in 1:p) S[i,j] <- 0.5^(abs(i-j)) x <- mvrnorm(n,rep(0,p),S) y <- x%*%beta0+rcauchy(n) obj <- rrr(x,y) # beta obj$beta.sic # Boston Housing library(mlbench) data(BostonHousing) bh <- BostonHousing bh$chas <- as.numeric(bh$chas) x <- as.matrix(bh[,-14]) y <- log(bh[,14]) bh.fit <- rrr(x,y)