Darwin Help

Back to Index

ExpFit

Function ExpFit - Least squares exponential fit: y[i] ~ a + b * exp(c*x[i])

Calling Sequence  ExpFit(y,x)
Parameters
NameTypeDescription

x array(numeric)dependent variable
y array(numeric)independent variable
Return Type  [a,b,c,sumsq]
Synopsis Compute a least squares fit of the type:

          y[i] ~ a + b * exp(c*x[i])


where a,b and c are the parameters of the approximation and sumsq is the sum of the squares of the errors of the approximation.

Examples
> x := [1,2,3,4,5];
x := [1, 2, 3, 4, 5]
> y := [0.49, 1.02, 2.1, 4.01, 7.8];
y := [0.4900, 1.0200, 2.1000, 4.0100, 7.8000]
> ExpFit(y,x);
[-0.1014, 0.3113, 0.6467, 0.00204305]


See also ExpFit2,   LinearRegression,   Stat