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, returns the 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 'covar',
CovB)nlinfit). ci is a
-by- matrix whose rows are the lower and upper bounds for the
corresponding coefficient.
ci = nlparci (beta, resid, instead derives the coefficient covariance from the Jacobian
J and the residuals. A legacy positional form 'jacobian',
J)nlparci
(beta, resid, J) is also accepted.
The confidence level defaults to ; pass for a interval. The intervals use
Student’s distribution with 'alpha',
alphanumel (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