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?
2026-03-30 16:45:40.1774889140
On
How can I scale a sigmoid curve to fit the criteria I would like
1.2k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
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:
- Take $f$, a smooth, $S$ shaped function.
- Solve the following equations for $a$ and $b$: $$af(0) + b = -1\\ a f(n) + b = 1$$
- The function $g(x) = af(x) + b$ is $S$ shaped, and it maps $0$ to $-1$ and $n$ to $1$. You are done!
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})$.