I am looking for a C# implementation of the Levenberg–Marquardt algorithm for non-linear least squares fit.
C# implementation of Levenberg–Marquardt algorithm [closed]
Asked Answered
Levenberg-Marquardt.NET by Krzysztof Kniaz has worked very well for me.
Thanks! I had a look at it a while ago, I couldnt get it to work when I had several input and output parameters for each data point. –
Enemy
Thanks! I had a look at it a while ago, I couldnt get it to work when I had several input and output parameters for each data point. Basically I have 3-D input coordinates and 3-D output coordinates, and 3-D reference coordinates for each data point. The 12 parameter function is supposed to make the output equal to the reference value for each point. Thus I calculate the norm of the error (reference value - output value) for each data point in the set as the function I want to minimize. I wasnt able to rewrite the code so that it achieved this. –
Enemy
Instead I use a robust c++ program and a c++ to c# wrapper function. –
Enemy
Sorry that library did not work for you but good to hear you found a way to do it. Do you mind sharing which C++ library you used? Have you considered trying to port it to C#? Not worth the effort or are you concerned about speed? –
Richelle
joachimwuttke.de/lmfit/index.html the library is in c. the quick and dirty solution i did was to compile the source code as a c++ project, and create a dll that could be executed from c#, using DllExport() / DllImport() –
Enemy
I moved the lmfit repository to apps.jcns.fz-juelich.de/lmfit. –
Tailorbird
You might want to try csmpfit. It is open source.
Update:
The project has been moved to GitHub at https://github.com/cureos/csmpfit.
This one is really easy and works flawlessly –
Misjoinder
Here is an explanation article plus C# code:
http://www.imagingshop.com/articles/least-squares
It uses Math.NET Numerics for linear algebra to simplify the Levenberg-Marquardt algorithm.
© 2022 - 2024 — McMap. All rights reserved.