Optimisation Algorithm and Levenberg-Marquardt for fitglm in MATLAB
7 ビュー (過去 30 日間)
I am currently working with the `fitglm` function in MATLAB for fitting Generalized Linear Models (GLMs). While using `fitglm`, I found it challenging to report the specific optimization algorithm used for fitting the model, as the documentation does not provide this information explicitly.
Therefore, I would like to ask the MATLAB community if anyone knows the optimization algorithm employed by `fitglm` when fitting GLMs. It would be helpful to understand the algorithmic details to better interpret and report the results.
Additionally, I am curious if it is possible to utilize the Levenberg-Marquardt algorithm as an alternative optimization method for fitting GLMs using `fitglm`. If anyone has insights or suggestions on how to incorporate the Levenberg-Marquardt algorithm in the context of `fitglm`, I would greatly appreciate your input.
Thank you for your assistance!
回答 (1 件)
John D'Errico 2023 年 5 月 29 日
The important thing you need to recognize is that fitglm fits a LINEAR model. No nonlinear iterations will be performed.
As such, fitglm will use little more than backslash to estimate the parameters. Yes, there are some modes fitglm operates in where something special needs to be done. For example, categorical variables. But that just ends up forcing the code to create a dummy variable.
Finally, I see that fitglm allows the providion of some other distribution for the response variable than the default Normal. In any event though, Levenberg-Marquardt would not be appropriate for a non-Normal case.
Is there any reason why you would rationally want to use Levenberg-Marquardt for this? NO. Only that you think it would be interesting? Well, yes, it MIGHT be interesting to carry a pea to Boston with a Mack truck. But only if your goal was to use the completely wrong tool to solve the problem.