How to use the Levenberg-Marquardt algorithm to fitting data and get the first derivative?

368 ビュー (過去 30 日間)
Nelson Saraiva
Nelson Saraiva 2019 年 2 月 24 日
回答済み: Dhananjaya 2023 年 10 月 10 日
I'm implementing the Levenberg-Marquardt algorithm in matlab to minimize a set of data resulting from a black-box equation.
My question is how to calculate the jacobian matrix from the set of data?
  3 件のコメント
Zakaria OUAOUJA
Zakaria OUAOUJA 2021 年 10 月 4 日
That's exactly what I am trying to do, I am trying to minimize an output data resulting from a black-box software equations, and I am using the finite difference approximation for the Jacobian but it never works, and I can't find something helpful on the internet.
If you have solved the problem I would appreciate it if you could help me solve it too.
karima ettourabi
karima ettourabi 2021 年 11 月 4 日
If you have solved the problem I would appreciate it if you could help me solve it too. please

サインインしてコメントする。

回答 (2 件)

Robert U
Robert U 2019 年 2 月 25 日
Hi Nelson Saraiva,
The Levenberg-Marquardt algorithm is already ready-to-use implemented into optimization toolbox: https://de.mathworks.com/help/optim/ug/lsqcurvefit.html?searchHighlight=lsqcurvefit&s_tid=doc_srchtitle
There are lots of descriptions on implementation on the internet. As an example, with implementation: http://people.duke.edu/%7Ehpgavin/ce281/lm.pdf
For most curve-fitting algorithms you have to have a model function defined with a set of free parameters. In order to find best fitting results with as less iterations as possible some algorithms (see gradient descent methods) do implement a kind of sensitivity analysis on all the free parameters. That would be the Jacobian matrix. Thus, Jacobian matrix does not depend on your data set but on the model function you chose.
Kind regards,
Robert
  2 件のコメント
Naif Alsalem
Naif Alsalem 2021 年 6 月 24 日
Robert,
I came by your answer and i though it is very informative. If you dont mind, i have, say, measured & predicated spectra that i need to compare using LM method in matlab.
X= measured; Y= predicated;
How would i used LM function that is already included in matlab to fit these spectra?
Thank you very much in advance.
Abhilash Awasthi
Abhilash Awasthi 2022 年 9 月 15 日
@Naif Alsalem you can define your objective function as the difference between X & Y as a column vector. Then you can use the MATLAB inbuilt function 'lsqnonlin' from Optimization toolbox. You can also play with the options if you want to have a better control over your algorithm. Check this link for more details.

サインインしてコメントする。


Dhananjaya
Dhananjaya 2023 年 10 月 10 日
I want to train a neural network with some simulated data using Levenberg-Marquardt algorithm. Can anyone provide me the code.

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by