fitting with my function

12 ビュー (過去 30 日間)
laurent jalabert
laurent jalabert 2019 年 7 月 4 日
編集済み: the cyclist 2019 年 7 月 4 日
Hello,
I would like to fit experimental data using my own fit function. My function depends on 2 parameters (p1,p2) that I would like to output from the fit. The function I would like to use is based on a sum of series (for n=1 to 1000) that includes X and the parameters. This function is non linear. X is a vector. I have a rough idea about the values of p1 and p2.
It is like : y = sum(p1*tanh(n*p2/x) )
The function fminsearch does not work. With Mathematica, it is quite easy to fit. But my main program is based on 1000 lines of matlab code to analyse 20Mo of experimental data, so I would like to implement this fit in my matlab code. I cannot execute mathematica for each set of data, it is too much time consumming.
I am wondering which matlab toolbox I should purchase in order to solve my problem ?
There are curve fitting and optimization toolboxes that might include advanced mathematics using lqcurvefit or else. There are also ezyfit function, easyfit function, and maybe much more on some forums.
Any advices ?
  1 件のコメント
Torsten
Torsten 2019 年 7 月 4 日
For two parameters, fminsearch should work. What is your code ?

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

回答 (1 件)

the cyclist
the cyclist 2019 年 7 月 4 日
編集済み: the cyclist 2019 年 7 月 4 日
If you have the Statistics and Machine Learning Toolbox, then fitnlm is probably your best option for this sort of non-linear fit.

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by