Calculate the equation of a sigmoid curve given (partial) data that looks like an exponential fit

512 Views Asked by At

The data that I am modeling should follow a sigmoid curve, however, I am only given a partial amount of data that looks like an exponential trend.

How can I calculate the equation of a sigmoid curve that best fits this partial amount of data? I have attached an image further explaining the problem. The partial data I have fits a curve in black, I want to produce an equation for a sigmoid curve (in blue).

Any thoughts on the best way to approach this problem? TIA

1

There are 1 best solutions below

0
On BEST ANSWER

First, you need to define what you mean by sigmoid curve. In this answer I will use

$$S(x;a,b)=\frac{a}{1-e^{-bx}}, \quad a,b \in \mathbb R,b\neq 0$$

Where $a,b$ are your parameters. e.g., increasing $|a|$ stretches your sigmoid along the y-axis, and changing $|b|$ stretches it along the x-axis. You could use more/less/other parameters.

Then is the question of finding the best fit. One common method is minimising the sum of the distances between your data points and your sigmoid (or least-squares method). There are other methods available, but for this simple problem, I assume this is the one you need.

Suppose your data is $(x_1,y_1),..., (x_n,y_n)$. Then your problem is about finding the values of $a$ and $b$ that minimise the quantity

$$F(a,b)=\sum_i ||y_i-S(x_i;a,b)||^2$$

If your dataset is small you can do it by hand. Otherwise, you can appeal to optimisation algorithms such as gradient descent or simulated annealing. Good luck!