Is it possible to generate standard error estimates for the parameters generated by LSQCURVEFIT?

25 vues (au cours des 30 derniers jours)
I would like to calculate standard error estimates for the parameters and/or the response values of the fit generated by LSQCURVEFIT.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 7 Sep 2012
The LSQCURVEFIT function does not estimate the covariance matrix for the fitted coefficients, thus this function should not be used to estimate standard error estimates for the model parameters. Instead, the NLINFIT function may be used with the NLPARCI function. These functions are contained in the Statistics Toolbox.
For an example of using NLINFIT with NLPARCI, please see the documentation for NLPARCI by typing the following at the MATLAB command prompt:
doc nlparci
Note that while NLPARCI does calculate the standard error of the parameters internally, it does not return this value as an output argument. It returns confidence intervals on the parameters of nonlinear models, as the confidence interval is usually of more interest. To retrieve the standard error, you must modify the function header for NLPARCI to include a second output argument, 'se'. This may be done by opening the NLPARCI function in the MATLAB editor and modifying the first line to read as follows:
function [ci se] = nlparci(beta,resid,varargin)
After these changes are saved, the modified function will return the estimated standard error of the parameters as the second output argument.
In R2012a the NonlinearModel class was created. This class allows you to get standard errors:

Plus de réponses (0)

Catégories

En savoir plus sur Least Squares dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by