Normalize option in curve fitting toolbox. How does it work?
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (2)
MattH
am 16 Apr. 2018
Bearbeitet: MattH
am 16 Apr. 2018
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 Kommentare
JOHN GONZALEZ
am 16 Mai 2022
Bearbeitet: JOHN GONZALEZ
am 16 Mai 2022
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.

0 Kommentare
Siehe auch
Kategorien
Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!