[R] ridge regression

2009-08-19 Thread spime
Dear all, I considered an ordinary ridge regression problem. I followed three different ways: 1. estimate beta without any standardization 2. estimate standardized beta (standardizing X and y) and then again convert back 3. estimate beta using lm.ridge() function X<-matrix(c(1,2,9,3,2,4,7,2,3

[R] R-package question

2009-07-19 Thread spime
Dear R-users, Suppose I want to modify and use internal functions of an R-package as my requirement. By any way is it possible to explore the internal coding structure of a package and get a list of internal functions? thanks. -- View this message in context: http://www.nabble.com/R-package-q

[R] Plotting problem [lars()/elasticnet()]

2009-07-11 Thread spime
Dear all, I am using modified LARS algorithm (ref: The Adaptive Lasso and Its Oracle Properties, Zou 2006) for adaptive lasso penalized linear regression. 1. w(j) <- |beta_ols(j)|^(-gamma) gamma>0 and j = 1,...,p 2. define x_new(j) <- x(j)*w(j) 3. apply LARS to solve modified lasso pr

[R] Error due to non-conformable arrays

2009-07-07 Thread spime
Hello, Consider this function for generalized ridge regression: gre <- function (X,y,D){ n <- dim(X)[1] p <- dim(X)[2] intercept <- rep(1, n) X <- cbind(intercept, X) X2D <- crossprod(X,X)+ D Xy <- crossprod(X,y) bth <- qr.solve(

[R] mlbench dataset question

2009-07-06 Thread spime
Dear R-users, Recently, I am facing some problems when converting mlbench data into matrix format. library(mlbench) data(BostonHousing) X<- BostonHousing[,1:13] y<-BostonHousing[,14] I want to convert X and y into matrix form. I am getting these obvious errors... > t(X)%*%y Error in t(X) %*% y