DADiSP Worksheet Functions > Function Categories > Curve Fitting > GAUSSFIT
Fits y(x) = A e-B(x-C)2 using linearization.
GAUSSFIT(series)
(fit, coef) = GAUSSFIT(series)
(fit, A, B, C) = GAUSSFIT(series)
series |
- |
Input series or array. |
A series.
(fit, coef) = GAUSSFIT(series) returns both the fit and the coefficients as a series.
(fit, A, B, C) = GAUSSFIT(series) returns both the fit as a series and the coefficients as separate coefficients.
W1: 10 * exp(-0.5 * ((-10..0.01..10) - 2)^2)
W2: gaussfit(w1);overp(w1, lred)
overplots the original data with the calculated Gaussian fit.
(fit, coef) = gaussfit(w1)
fit is the same series as in W2,
coef == {10.0, 0.5, 2}
(fit, A, B, C) = gaussfit(w1)
fit is the same series as in W2,
A == 10.0
B == 0.5
C == 2
GAUSSFIT fits an exponential curve of the form:
The fit is accomplished by fitting a polynomial to the following equation:
The fitted Gaussian curve (fit, coef) = gaussfit(series) returns both the fit and the coefficients as a series where coef is in the form {A, B, C}.
If y is not positive, the result will be complex.