What is the algorithm used in NLPARCI in the Statistics Toolbox?

13 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The method used to compute the confidence intervals is based on an "asymptotic normal distribution for the parameter estimate". They are not based on "likelihood ratios." For a linear regression of Y on X, confidence bounds on the parameters can be calculated by a method that is roughly equivalent to this:
b = x\y;
% coefficient estimates
r = y-x*b;
% residuals
df = (length(y)-length(b));
% residual degrees of freedom
s2 = (norm(r))^2 / df;
% estimated residual variance
v = s2 * inv(x'*x);
% estimated coefficient variance
b + tinv(.975,df) * sqrt(diag(v))
% upper confidence bounds
b - tinv(.975,df) * sqrt(diag(v))
% lower confidence bounds
For nonlinear regression, bounds are computed the same way except:
1. b is computed using NLINFIT.
2. r is computed by evaluating the nonlinear function.
3. The n-by-p Jacobian matrix is used in place of x in the expression for v. The value in row i, column j is the derivative of the nonlinear function with respect to the j th coefficient, evaluated at the i th data point.
In either the linear or nonlinear case, MATLAB uses a calculation formula that is equivalent to this one but numerically more stable.
Please also see the following reference for nonlinear data fitting:
Bates, Douglas, M. and Watts, Donald G., "Nonlinear Regression Analysis and Its Applications." John Wiley & Sons, NY. (1988).
Pages 52-60 discuss and show formulae for approximate confidence intervals on the parameters and expected response.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!