Darwin Help

Back to Index

ExpFit2

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

Calling Sequence  ExpFit2(y,x)
Parameters
NameTypeDescription

y array(numeric)dependent variable
x array(numeric)independent variable
Return Type  [a, b, sumsq]
Synopsis Compute the least squares fit of the type y[i] ~ a * exp(b * x[i]). sumsq is the sum of squares of the approximation errors.
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]
> ExpFit2(y,x);
[0.2771, 0.6677, 0.00586200]


See also ExpFit,   LinearRegression,   Stat