Re: [R] Error due to non-conformable arrays

2009-07-07 Thread Jorge Ivan Velez
Hi spime, What is "x"? Did you have any other "X" defined in your R-session? Be aware that R is case-sensitive. Best, Jorge On Tue, Jul 7, 2009 at 1:30 PM, spime wrote: > > Hello, > > Consider this function for generalized ridge regression: > > gre <- function (X,y,D){ >n <- dim(X)[1]

Re: [R] Error due to non-conformable arrays

2009-07-07 Thread David Winsemius
Incomplete code leaves us able to do naught but guess; Perhaps you are unaware that x != X -- DW On Jul 7, 2009, at 1:30 PM, spime wrote: Hello, Consider this function for generalized ridge regression: gre <- function (X,y,D){ n <- dim(X)[1] p <- dim(X)[2] interce

Re: [R] Error due to non-conformable arrays

2009-07-07 Thread Henrique Dallazuanna
I think that is because X in your function has (n + 1) columns and D with only n coluimns: matrix(1:9, ncol = 3) + matrix(1:8, ncol = 2) On Tue, Jul 7, 2009 at 2:30 PM, spime wrote: > > Hello, > > Consider this function for generalized ridge regression: > > gre <- function (X,y,D){ >n <

[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(