# Need a function to fit the following data

I need to fit a function to this particular set of data points, but I can't find anything with this general form. I have found a great fit for the inverse of this graph using the form

$$x(y) = \frac{a}{b\exp{(cy-y_c)}+d}+e$$

with the values $a=25.0989,\, b=0.2459,\, c=3.1954,\, d=0.0961,\, e=2.8681,\, y_c=-2.1852$, but inverting this function gives me

$$y(x) = \left[\ln{\left(\frac{a}{x-e}-d\right)} - \ln{(b)} + y_c \right]/c$$

at, say, x = 0 or x = 265 the logarithm is undefined. How can I obtain a function valid over the entire range [0, 265]?

Data points: $$x = [0, 5, 17, 27, 38, 74, 137, 161, 184, 209, 239, 253, 265]$$ $$y = [2.8808, 0.4771, 0, -0.2218, -0.3979, -0.6990, -1.0000, -1.0969, -1.2218, -1.3979, -1.6990, -2.0000, -3.0000]$$

Edit: included data values;

Edit 2: rewrote fit equation in terms of y for coherence; added inverse function to better demonstrate the issue; added calculated coefficients;

Edit 3: change 'e' to 'exp' for clarity.

• It would be much easier to work with the data if you give the numerical values. – Matti P. Jul 4 '18 at 6:00
• Added the numerical values if that helps, but all I'm looking for is an analytical function with that general shape. – Matheus Leão Jul 4 '18 at 6:30
• I don't see the problem with inverting your $f(x)$. You subtract $e$, invert, multiply by $a$, subtract $d$, divide by $b$, take the log, add $x_c$, and divide by $c$. – Gerry Myerson Jul 4 '18 at 6:48
• Doing that will give me complex values for certain point. All the coefficients are positive, so popping x = 0 into that equation results in a natural logarithm of a negative number, which doesn't have a real answer. – Matheus Leão Jul 4 '18 at 8:49
• Are you using $e$ with two meanings: Euler's $2.71828\ldots$ and your calculated $2.8681$? – Henry Jul 4 '18 at 9:05