Search
Question: Bug in gpls package?
0
gravatar for Carlos J. Gil Bellosta
7.5 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 glpls1a.cv.error 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 http://www.datanalytics.com
ADD COMMENTlink written 7.5 years ago by Carlos J. Gil Bellosta 40
Please log in to add an answer.

Help
Access

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