Fitting a Function with trainlm to find function parameters?

11 Ansichten (letzte 30 Tage)
gary_feesher
gary_feesher am 9 Okt. 2016
Beantwortet: Greg Heath am 17 Okt. 2016
I would like to fit a curve with the Levenberg-Marquardt (LM) Algorithm, and I was wondering if it is possible to use the trainlm algorithm?
For example, I would like to fit a set of data points to with:
f(x) = a*sin(x) + b*cos(x).
I would like to estimate a and b using the LM algorithm in Matlab. Is this possible simply with the trainlm algorithm?
I have found a variety of sources, like: Curve Fitting via Optimization, but I am unable to Open the Script to view the source code.

Antworten (2)

Matt J
Matt J am 9 Okt. 2016
Bearbeitet: Matt J am 9 Okt. 2016
Why not just use the Levenberg-Marquardt option of LSQCURVEFIT? Also, I hope you know that your example, a linear estimation problem, is far too trivial to bother with Levenberg-Marquardt. You could do it analytically with MLDIVIDE.

Greg Heath
Greg Heath am 17 Okt. 2016
Think of a neural net as a mapping between I-dimensional "I"nputs and O-dimensional "O"utputs achieved by using N pairs of I-dimensional input examples and corresponding O-dimensional output target examples.
Your problem does not fit into that category.
Hope this helps.
Thank you for formally accepting my answer
Greg

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by