Categories &

Functions List

Function Reference: nlparci

statistics: ci = nlparci (beta, resid, 'covar', CovB)
statistics: ci = nlparci (beta, resid, 'jacobian', J)
statistics: ci = nlparci (…, 'alpha', alpha)

Confidence intervals for the coefficients of a nonlinear regression.

ci = nlparci (beta, resid, 'covar', CovB) returns the 100 (1 - alpha)% confidence intervals for the fitted coefficients beta of a nonlinear regression, given the residual vector resid and the estimated coefficient covariance matrix CovB (both produced by nlinfit). ci is a p-by-2 matrix whose rows are the lower and upper bounds for the corresponding coefficient.

ci = nlparci (beta, resid, 'jacobian', J) instead derives the coefficient covariance from the Jacobian J and the residuals. A legacy positional form nlparci (beta, resid, J) is also accepted.

The confidence level defaults to 95%; pass 'alpha', alpha for a 100 (1 - alpha)% interval. The intervals use Student’s t distribution with numel (resid) - numel (beta) degrees of freedom.

See also: nlinfit, nlpredci, fitnlm, NonLinearModel

Source Code: nlparci

95% confidence intervals for the coefficients of an exponential fit.

 x = [1:10]';
 y = [2.1;2.9;4.2;5.3;7.1;9.4;12.8;16.5;22.1;29.8];
 modelfun = @(b, x) b(1) .* exp (b(2) .* x);
 [beta, R, J, CovB] = nlinfit (x, y, modelfun, [1; 0.3]);
 ci = nlparci (beta, R, 'covar', CovB)
ci =

   1.6026   1.7649
   0.2815   0.2923