Closed gittybobomber closed 2 years ago
Please don't crosspost. You haven't demonstrated an issue in nloptr, you are asking for help using it (and posting at SO was a good first step).
I think I have similar 'finger exercises" as a gradstudent but I think you should reformulate your problem as a likelihood maximization (where we know OLS aka lm()
has the BLUE properties [and per Hansen (2021) even BUE but I digree]). You then be able to recover the parameters estimates in one project step by lm()
.
Thanks for your comment. I found out that the answer on my question is: Use "algorithm"="NLOPT_LN_SBPLX"
Thanks @eddelbuettel for following up on this. I'll close the issue.
It seems to be impossible to get the correct result for a multiple regression with nloptr, as the iterations stop too early. Message says "Optimization stopped because ftol_rel or ftol_abs (above) was reached. " but this does not seem plausible at (as compared tp lm or optim).
I described the problem including sample code here: https://stackoverflow.com/questions/71563947/r-nloptr-problem-rebuilding-linear-regression-optimization-stops-too-early
Is there a solution?