How can I scale a sigmoid curve to fit the criteria I would like

1.2k Views Asked by At

Is there a way I can make a scaled sigmoid function $f(x)$ such that $f(0) \to -1$ (or as close to it as possible) and $f(n) \to 1$ (or as close to it as possible), for whatever $n$ I choose?

2

There are 2 best solutions below

1
On BEST ANSWER

While I agree with 5xum, I will give another solution, using the sigmoid function. The function that I would present is $$ f(x) = 2\left(1+\exp\left\{ -\ln(40~000) \frac{x-n}{n} + \ln(0.005) \right\} \right)^{-1} +1 $$ Here is a visualization: https://www.desmos.com/calculator/2ah3qgjbim

Notice that I have determined the coefficients $\ln (40~000)$ and $\ln (0.005)$ by setting certain values for $f(0)$ and $f(n)$. They can be replaced by $\ln(\text{a large number})$ and $\ln(\text{a small but positive number})$.

0
On

There are infinitely many "smooth, $S$ shaped functions" that map $0$ to $-1$ and $n$ to $1$. Here is the process of obtaining them:

  1. Take $f$, a smooth, $S$ shaped function.
  2. Solve the following equations for $a$ and $b$: $$af(0) + b = -1\\ a f(n) + b = 1$$
  3. The function $g(x) = af(x) + b$ is $S$ shaped, and it maps $0$ to $-1$ and $n$ to $1$. You are done!