standard deviation of parameters in lsqcurvefit?

19 visualizaciones (últimos 30 días)
Morteza
Morteza el 19 de Sept. de 2014
Comentada: Benjamin el 25 de Mzo. de 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

Respuesta aceptada

Star Strider
Star Strider el 19 de Sept. de 2014
  1. If you have the Statistics Toolbox, you can use nlparci to get the confidence intervals on the parameter estimates.
  2. I am not certain what you want, but there are output Options you can set that will give you iteration updates with varying degrees of detail.
  3 comentarios
Star Strider
Star Strider el 24 de Sept. de 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
Benjamin el 25 de Mzo. de 2021
Correct. So in other words,
Standard deviation = SD = (ci(2) - beta)/2
Because nlparci gives the 95% confidence interval which is (+/-)2*SD.

Iniciar sesión para comentar.

Más respuestas (1)

Matt J
Matt J el 19 de Sept. de 2014
Editada: Matt J el 19 de Sept. de 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.

Categorías

Más información sobre Nonlinear Optimization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by