error window to a model function after nlinfit
Ältere Kommentare anzeigen
Hi I use nlinfit to fit an equation to a model, and get the value of the parameter with its associated error. Now I want to use this parameter with its error and plot another function, which should show the error region as well! For example: Equation 1: y=Acos(x)+Bsin(x) is fitted using nlinfit to give this. A=5 +- 0.1 B=3+-0.2 Now I want to use these values of A and B (with errors) to plot a function Y+-delY=(A+-delA)cosx +(B+-delB)sinx where del is the error .
Thanks
Akzeptierte Antwort
Weitere Antworten (2)
Star Strider
am 14 Mär. 2017
1 Stimme
You have used the nlparci function to get the parameter confidence intervals.
The correct way to do what you want, that is to express the errors in the fit with respect to your data, is to calculate the confidence intervals on the prediction with the nlpredci function. That will give you the correct statistical result. It is also much more straightforward to implement.
The initially accepted answer is incorrect.
2 Kommentare
DebiPrasad
am 14 Mär. 2017
Star Strider
am 14 Mär. 2017
Hi Debi,
The nlinfit function does not allow you to constrain the parameters. The lsqcurvefit function does.
If you have the Optimization Toolbox, see if using the lsqcurvefit function with constraints on the parameter you want to limit will give you an acceptable fit to your data. I believe you can use nlparci and nlpredci with constrained parameter estimation outputs returned by lsqcurvefit, and I see nothing in the documentation for either function that indicates it would not be appropriate. (I know you can use them with lsqcurvefit with unconstrained parameters.)
Kategorien
Mehr zu Gaussian Process Regression finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
