Mathematics    

Error Bounds

Error bounds are useful for determining if your data is reasonably modeled by the fit. An optional second output parameter can be obtained from polyfit and passed as an input parameter to polyval in order to obtain the error bounds.

For example, the code below uses polyfit and polyval to produce error bounds for a second-order polynomial model. Year values are normalized. This code uses an interval of ±2, corresponding to a 95% confidence interval.


 Exponential Fit The Basic Fitting Interface