standard deviation of parameters in lsqcurvefit?
35 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Morteza
am 19 Sep. 2014
Kommentiert: Benjamin
am 25 Mär. 2021
1-Is there a way to get the standard deviation or any measure of error for the optimized parameters when using lsqcurvefit?
2-can someone tell me how to get the error surface( it could one multi-dimensional depending on the number of parameters you're optimizing) in lsqcurvefit? saying it differently the amount of error in each step it is going through along with the value of parameters at that step.
I've attached a simple example of lsqcurvefit. can you show me the standard deviation on that if possible.
Thanks
0 Kommentare
Akzeptierte Antwort
Star Strider
am 19 Sep. 2014
3 Kommentare
Star Strider
am 24 Sep. 2014
The nlparci function will provide those for you, although instead of presenting them as, for instance, 5±0.2, it will present them as [4.8 5.2]. But it will give you the information you want about them.
For lsqcurvefit, you have to request all the outputs, in this syntax:
[beta,resnorm,resid,exitflag,output,lambda,J] = lsqcurvefit(...)
and then to get the confidence intervals from nlinfit, use this syntax for it:
ci = nlparci(beta,resid,'jacobian',J)
The output ‘ci’ are the confidence intervals for each parameter in the sequence you have presented them to nlparci in the ‘beta’ vector.
Benjamin
am 25 Mär. 2021
Correct. So in other words,
Standard deviation = SD = (ci(2) - beta)/2
Because nlparci gives the 95% confidence interval which is (+/-)2*SD.
Weitere Antworten (1)
Matt J
am 19 Sep. 2014
Bearbeitet: Matt J
am 19 Sep. 2014
1. You could compute parameter covariance estimates from the output Jacobian and residuals,
[x,resnorm,residual,exitflag,output,lambda,J]= lsqcurvefit(...)
xCovariance = inv(J.'*J)*var(residual)
2. Wasn't entirely clear to me what you're asking for, but it sounds like you want to use the PlotFcns input option with @optimplotresnorm.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Interpolation 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!