Question: Bug in gpls package?
gravatar for Carlos J. Gil Bellosta
8.6 years ago by
Hello, I am submitting this mail to this address as it is the one provided in the gpls package for maintenance. I think I came accross a bug in the function in such package. This function calls the unexported function glpls1a.predict which is defined as follows: function (X, beta, family = "binomial", link = "logit") { if (all(X[, 1] == rep(1, nrow(X)))) { eta <- X %*% beta } else { eta <- cbind(rep(1, nrow(X)), X) %*% beta } return(h(eta, family, link)) } I.e., the function checks whether the first row in the new data is all ones (looking for an intercept maybe?) and if so, decides that X and beta are conformable. As I was applying a cv analysis, nrow( X ) was 1 and the first element in X was 1 just by chance for one observation (not an intercept) so the the wrong option was taken resulting in "non-conformable arguments" for matrix multiplication. Is there a safer way to check for intercepts other than comparing the first row to a vector of ones? Best regards, Carlos J. Gil Bellosta
gpls • 392 views
ADD COMMENTlink written 8.6 years ago by Carlos J. Gil Bellosta 40
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 154 users visited in the last hour