[Math] (Computationally) Simple sigmoid with specific slopes at specific points

functions

This is a refinement of this question: (Computationally) Simple sigmoid.

Ideally, I would like to have relatively simple sigmoid function with the following properties:

  1. derivatives at -1 and 1 are zero
  2. derivative is not zero between -1 and 1
  3. derivative at 0 is 1, maybe can be controlled with a parameter
  4. I can control the change in derivative near -1 and 1 within (-1,1), so that the derivative doesn't depart from zero too quickly or too slowly.
  5. The curve is "symmetric" in the sense that flipping the curve on [0,1] both vertically and horizontally produces the curve on [0,1].

Approximations to items 1 through 5 are OK. This is for a computer simulation in which values $c$ in [-1,1] cause an increase or decrease in other values $e$ in [-1,1]. I want $e$ to change quickly when it's pushed around in the middle range near 0, but to be pushed up slowly when it's near 1, and similarly when pushed down near -1. I just need a function that works well enough; it doesn't have to perfect.

I've had trouble figuring out how to tune the sigmoids I'm aware of in order to get properties that are close to 1 through 5.

Thanks!

Best Answer

So a possible solution is $$\tanh\frac{kx}{(1-x^2)^{1/n}}$$ For $k > 0, n \geq 1$ being a constants for adjustment of the function as you like.
In general to explain how you can construct more sigmoid functions. Let's assume we have a sigmoid function $f(x):\mathbb{R} \rightarrow[-1;1]$ and we want to make it to find $g(x): [-1;1] \rightarrow[-1;1]$ what we can do is use a mapping $h(x):[-1;1] \rightarrow [-\infty ; \infty]$ and define $g(x) = f(h(x))$. Such mapping is $h(x) = \frac{kx}{(1-x^2)^{1/n}}$. Using this you can build and more functions for what you need using different well known sigmoids. And you should play a bit with $k$ and $n$ to find a good solution.
And don't forget that for any sigmoid $f(x):\mathbb{R} \rightarrow [0;1]$ you can transform them to $[-1;1]$ by taking $2*f(x)-1$ and vice versa.