I'm looking for a function $f_t: [-1, 1] \rightarrow [-1, 1]$ parameterized by a "threshold" $t\in(-1, 1)$ that meets the following constraints:
- $f_t(x)$ is smooth and monotonically increasing in $x \in [-1, 1], \forall t \in (-1, 1)$
- $f_t(-1)=-1$, $f_t(1)=1, f_t(t)=0$, $\forall t \in (-1, 1)$
- $f(x)_{t=0}=x$
What is the right functional form here? Thoughts so far...
- Quadratic is out - it can satisfy (2) but is not monotonic for all t
- Cubic could work - but there are 4 parameters and only 3 constraints.
Keywords (because I can't add tags) Soft threshold, sigmoid, nonlinearity



Ok, got it. Idea is to remap our domain and range from [-1, 1] to [0, 1], and note that, using the functional form $f(x) = x^p$, you can remain monotonic while passing through (0, 0), (t, 0.5), and (1, 1), for any $t \in (0, 1)$. Solving for $p$ gives us:
$$ g_t(x) = x^{-\log(2)/\log(t)} $$
Which looks like an asymmetric onion:
This alone would be fine to satisfy the constraints. (We just need to remap domain and range from $[0, 1]$ to $[-1, 1]$). But we can make it a bit "nicer" by adding symmetry about the diagonal, by averaging the function with a mirror-image of itself:
$$ h_t(x) = (g_t(x)+1-g_{1-t}(1-x))/2 $$
And finally, remapping to [-1, 1] with
$$ f_t(x) = 2 h_{(t+1)/2}((x+1)/2)-1 $$
See colab notebook
I suspect this is equivalent to the superellipse solution mentioned by other commenters.
Update - this function can be generalized to have a "steepness parameter" controlling how steep it is in the middle (and causing it to saturate at the ends). See this post.