- Modify data. Add new data, remove outliers, and converting between data representations
- Change fit function. Use a function with more degrees.
- Remove upper and lower limits on the coefficients.
Huge Confidence Interval With predint
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm running into a confidence interval on a fit of some data. This is the code I'm using:
x0 = [1 1 1];
fitfun = fittype( @(a,b,c,x) a*x.^b+c)
[fitted_curve,gof] = fit(x,y,fitfun,'StartPoint',x0,'Weight', w, 'Lower', [0,-3,0],'Upper',[1000,0,1])
coeffvals = coeffvalues(fitted_curve);
p = predint(fitted_curve,x,0.001,'Observation','off');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/561518/image.png)
Where w is calculated from inverse cube weighting:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/561523/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/561528/image.png)
The fit works well for this very small confidence interval (.1 % for .001). When I try to make a more meaningful fit and use 95% confidence, I get this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/561533/image.png)
Is there a way I can get a closer result for this 95% interval? predint must use "Observation" and "off" (changing to "functional" makes interval smaller, but it's not what I'm looking for).
Thanks so much for your help.
0 Kommentare
Antworten (1)
Aditya Patil
am 31 Mär. 2021
As per my understanding, you want to get a fit with lower confidence interval.
For this, you need to do one or more of the following,
0 Kommentare
Siehe auch
Kategorien
Mehr zu Linear and Nonlinear Regression 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!