Exponential least-squares curve fit function. |
||
Syntax |
c,s,f = ExpCurveFit(Ind, Dep) |
|
Arguments |
Name |
Description |
Ind |
A vector of independent data. |
|
Dep |
A vector of dependent data. All entries must be positive. |
|
Outputs |
Name |
Description |
c |
A vector of the two coefficients. |
|
s |
A vector of the statistical fit quality. See Comments below. |
|
f |
A vector of an exponential least squares fit. |
|
Example |
For a given set of independent and dependent data find the best exponential fit. |
|
Syntax |
||
c,s,f = ExpCurveFit([1,2,3,4],[1,4,9,16]) |
||
Result |
||
c = 0.5 0.91 s = 3.28 0.95 f = 1.25 3.10 7.73 19.27 |
||
Comments |
The result is the exponential function, y = aebx, which best fits the original curve as determined by least squares criteria. The output c includes the two coefficients (a,b). The output s includes mean squared error and the correlation coefficient (the square root of the coefficient of determination R2 ) respectively. Ind and Dep must have the same number of elements. |
|
See Also: |