Optimisation Algorithm and Levenberg-Marquardt for fitglm in MATLAB

5 views (last 30 days)
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!

Answers (1)

John D'Errico
John D'Errico on 29 May 2023
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.
  1 Comment
bethel o
bethel o on 29 May 2023
Honestly, I am happy with results I got with fitglm. Another person, without giving any reason said the Levenberg-Marquardt method would give a better result.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!