You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xx<- seq(0.01,1,0.01)
zz<- cbind(sin(xx*2*pi), cos(xx*2*pi))
y<- rep(1, 100)
grpreg::grpreg(zz, y, group= c(1,2), lambda=10^seq(-3,20,1))
#> Error: Algorithm failed to converge for any values of lambda. This indicates a combination of (a) an ill-conditioned feature matrix X and (b) insufficient penalization. You must fix one or the other for your model to be identifiable.
For linear regression, grpreg checks convergence by comparing coefficient changes relative to the standard deviation of y. This was coded as:
maxChange<eps*sdy
for a constant response, however, the RHS is zero, so convergence could never be reached. Easy fix, replacing the < with <=. Should be working now. Thanks for bringing this to my attention!
I have the following example:
Created on 2021-08-11 by the reprex package (v2.0.0)
The
grpreg
throws an error rather than fit every coefficient to zero. What might cause such problem?The text was updated successfully, but these errors were encountered: