Categories &

Functions List

Function Reference: nlpredci

statistics: [ypred, delta] = nlpredci (modelfun, X, beta, resid, 'Jacobian', J)
statistics: [ypred, delta] = nlpredci (modelfun, X, beta, resid, 'Covar', CovB)
statistics: [ypred, delta] = nlpredci (…, Name, Value)

Confidence intervals for predictions of a nonlinear regression.

[ypred, delta] = nlpredci (modelfun, X, beta, resid, 'Jacobian', J) returns the predicted responses ypred of the model modelfun (beta, X) at the new predictor values X, together with the half-widths delta of the 100 (1 - alpha)% confidence intervals, so that ypred - delta and ypred + delta bound the response. beta, resid (the residuals) and J (the Jacobian) come from nlinfit.

Instead of the Jacobian, an estimated coefficient covariance may be supplied with 'Covar', CovB. The following Name/ Value pairs are also accepted:

NameValue
'MSE'The mean squared error from nlinfit, required with 'Covar' for observation (prediction) intervals.
'PredOpt''curve' (default) for confidence intervals on the fitted curve, or 'observation' for prediction intervals on a new observation.
'SimOpt''off' (default) for pointwise intervals, or 'on' for simultaneous (Scheffe) intervals.
'Alpha'The significance level; the interval has confidence 100 (1 - alpha)% (default alpha = 0.05).

Source Code: nlpredci

Algorithm

Each half-width is delta = c * sqrt (v). The variance v of the fitted curve is diag (Jnew * V * Jnew'), where V is the coefficient covariance (either CovB, or MSE * inv (J' * J) when a Jacobian is supplied) and Jnew is the Jacobian of modelfun at X; an 'observation' interval adds the error variance MSE to v. The critical value c is the Student’s t quantile at 1 - alpha/2 with the error degrees of freedom for a pointwise interval, or the Scheffe value sqrt (k * finv (1 - alpha, k, dfe)) for a simultaneous interval, where k is the number of coefficients (plus one for an observation interval).

See also: nlinfit, nlparci, fitnlm, NonLinearModel

Source Code: nlpredci

Prediction intervals for an exponential fit at three new x-values.

 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] = nlinfit (x, y, modelfun, [1; 0.3]);
 [ypred, delta] = nlpredci (modelfun, [2.5; 5.5; 8.5], beta, R, 'Jacobian', J)
ypred =

    3.4497
    8.1583
   19.2935

delta =

   0.1206
   0.1603
   0.1715