How can I predict a function f(x) based on given data value pairs?

I need to predict a function that can satisfy the value pairs given:

Table of values here

I tried plotting y against x, to see the graph shape and got something like this: Plot

How can I come up with a function that fits this curve well? I'm thinking of a tangent function but it's cyclic and goes to infinity (on the y-axis) so that wouldn't really work.

• Looks like a growth-sigma type of curve Apr 5, 2016 at 2:19

As Henry W. answered, you are looking for a logistic function, that is to say $$y=\frac L{1+e^{-k(x-x_0)}}$$ The model is highly nonlinear with respect to its parameters and the nonlinear regression you should use to get parameters $L,k,x_0$ will need some reasonable estimates.

What we know is that the upper asymptote is $L$; so, from the data $$\left( \begin{array}{cc} x & y \\ 0 & 0.090 \\ 18 & 0.102 \\ 78 & 0.124 \\ 142 & 0.253 \\ 205 & 0.487 \\ 255 & 1.020 \\ 322 & 1.980 \\ 378 & 3.950 \\ 446 & 5.880 \\ 504 & 6.760 \\ 564 & 7.200 \end{array} \right)$$ assume $L\approx8$; similarly, searching in the table the $x$ such that $y\approx \frac L2$, you can estimate that $x_0\approx 400$. Now, rewrite the model $$\log\big(\frac Ly-1\big)=-k(x-x_0)$$ Using the previous estimates, the plot of the approximation gives a slope $k\approx 0.02$. At this point, you have all required estimates and you can start the nonlinear regression.

This should give more or less $$y=\frac{7.52898}{1+e^{-0.0168888 (x-374.131)}}$$ $R^2=0.999245$ showing a very good fit. This is also confirmed by the statiscal information related to the parameters $$\begin{array}{clclclclc} \text{} & \text{Estimate} & \text{Standard Error} & \text{Confidence Interval} \\ x_0 & 374.131 & 4.48744 & \{363.52,384.742\} \\ k & 0.0168888 & 0.000939502 & \{0.0146673,0.0191104\} \\ L & 7.52898 & 0.161397 & \{7.14734,7.91063\} \\ \end{array}$$

• Very interesting derivation. Thx for sharing. Apr 6, 2016 at 8:33

You are looking for a Sigmoid. Or more specifically, a Logistic function. You can manipulate the parameters to determine the min and max points.

• Thanks, that helped a lot. Is it possible for me to adjust the bounds for the x-axis? for example if I want x from 0 to 600?
– Bei
Apr 5, 2016 at 4:15
• @Bei You will have to restrict it manually by truncating the graph. Apr 5, 2016 at 4:26
• Noted with thanks (:
– Bei
Apr 5, 2016 at 4:28