Normalize option in curve fitting toolbox. How does it work?

20 ビュー (過去 30 日間)
Kai
Kai 2013 年 4 月 24 日
編集済み: JOHN GONZALEZ 2022 年 5 月 16 日
Hello everybody,
I would like to regress a curve to the model:
F(t) = k * E(t) + r * E'(t) + u*E''(t) + c
Where the target function F(t) and the input function E(t) are experimental data.
To work with E(t) I fit a sigmoidal function to E(t):
E(t) = b(1) + b(2)./ (1 + exp( -(x - b(3)) ./ b(4)))
Here comes the problem: The fit to E(t) only works, if I set the fitoption 'normalize' to 'on' and the results are very good (r-square > 0.99). But now I want to use the coefficients in b as input to the model for the regression. Because b is from a normalized fit, I receive a different result for the individual terms by using b in the model.
Here is the code to determine b:
[xdata, ydata] = prepareCurveData( x, sig );
expr = @(b(1), b(2), b(3), b(4), x) b(1)+b(2)./(1+exp(-(x-b(3))./b(4)));
ft = fittype(expr, 'independent', 'x', 'dependent', 'y');
opts = fitoptions( ft );
opts.Normalize = 'on';
[fitresult, gof] = fit( xdata, ydata, ft, opts );
In other words: How can I reconstruct E(t) with the coefficients from a normalized E(t) in b?
I hope this is understandable and someone can point me in the right direction. If necessary I can also post the code for the regression on F(t).
Thanks in advance, Kai

回答 (2 件)

MattH
MattH 2018 年 4 月 16 日
編集済み: MattH 2018 年 4 月 16 日
I have a similar question.
From the fitresult "where x is normalized by mean 590.4 and std 151.7" it is possible to get X=(x-590.4)/151.7 and use the coefficients of the regression model(thus answering the question above)
The problem is how to do that programmatically ? It is possible to get the coefficient with coeffvalues(equation) but how can I retrieve mean and std ?
Any idea, anyone ?
Thanks
  2 件のコメント
MattH
MattH 2018 年 4 月 16 日
Found a workaround: recalculate mean and std from xData
JOHN GONZALEZ
JOHN GONZALEZ 2022 年 5 月 16 日
編集済み: JOHN GONZALEZ 2022 年 5 月 16 日
It works

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


JOHN GONZALEZ
JOHN GONZALEZ 2022 年 5 月 16 日
編集済み: JOHN GONZALEZ 2022 年 5 月 16 日
Hello, good afternoon
I had the same problem. I can't take the mean and std of the normalized x from the fit results to make the correct calculations of the regression. Usign the advice of MattH I calculate xmean and xsigma variables appart.

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by