I have n points (up to 513 points) that I need to fit in
y = y0 + a*exp(b*x)
I have been using MathNet.Numerics.Fit.Exponential
, but the problem is coeficient y0
, or when I have negative Y points, the result is
(NaN, NaN)
Example Points just first 7 points
double[] x = {0.000311999989207834, 0.00033149998853332363, 0.00035099998785881326, 0.0003704999871843029, 0.0003899999865097925, 0.00040949998583528213, 0.00042899998516077176};
double[] y = {-1.414255976676941, -1.415171504020691, -1.406565546989441, -1.3984631299972534, -1.398417353630066, -1.4013928174972534, -1.4019421339035034};
Tuple<double, double> t1 = Fit.Exponential(x, y);
Also I tried to find the lowest Y point and then substract from all points, but I think its not proper way to do it.
Reference photo (what I want to get): Graph of points and fit