osorensen / hdme

R-package containing penalized regression methods for High-Dimensional Measurement Error problems (errors-in-variables)
GNU General Public License v3.0
8 stars 3 forks source link

stopping rule for iterated projection of gradient seems off #40

Closed michaelpollmann closed 2 years ago

michaelpollmann commented 2 years ago

In the function project_gradient, the change between betaNew and betaOld is calculated as https://github.com/osorensen/hdme/blob/8153dd9f549fb9007a4b6757723045790dec808d/R/project_gradient.R#L13 I think this trades off changes along one coordinate against changes in another coordinate, such that the iteration may stop while some coordinates are still changing. I could imagine that one would want instead diff <- sum((betaNew - betaOld)^2) or diff <- sum(abs(betaNew - betaOld))

osorensen commented 2 years ago

Thanks! Your suggested change looks reasonable. I'll try to update it soon.

osorensen commented 2 years ago

Thanks again @michaelpollmann! This is on the master branch now, and I'll submit an update to CRAN soon.