1
$\begingroup$

It is well known that many sigmoid functions are approximately linear around x=0. I am looking for a sigmoid function that has a parameter that controls the length of this segment. I want to measure the length of this segment by its projection onto the y axis. Edit: The sigmoid function should map to the interval [-1, 1] on the y axis, so it is about which portion of this is linear. Additionally, the gradient at 0 should be 1.

In this image from Wikipedia I would consider erf as the most linear and x / (1 + |x|) the least linear: enter image description here

In the extreme linearity case I want the function to converge to being -1 for x<=1, x for -1<x<1 and 1 for x>1.

$\endgroup$
15
  • 1
    $\begingroup$ Just multiply its values by desired length: that scales everything on the y axis. But what would the potential statistical application of this be? $\endgroup$
    – whuber
    Commented Nov 14, 2022 at 22:03
  • 1
    $\begingroup$ What is your purpose? You can make the sigmoid so steep that the middle section is nearly vertical--it'd de quite useless but "straight". $\endgroup$
    – Tim
    Commented Nov 14, 2022 at 22:30
  • 2
    $\begingroup$ What do you need it for? Why do you need it linear? What is the underlying problem you are trying to solve? There is no strict definition of "sigmoid function" so you could create arbitrary functions that meet the conditions and are S-shaped. $\endgroup$
    – Tim
    Commented Nov 14, 2022 at 22:35
  • 2
    $\begingroup$ Why not just use a linear function truncated at bounds? $\endgroup$
    – Tim
    Commented Nov 14, 2022 at 23:06
  • 2
    $\begingroup$ Any sigmoid function $\sigma(x)$ can be re-expressed as $\sigma(ax + b)$ for $a \neq 0$. So if you're not asking about how to adjust $a$, I'm not sure what you're asking. And likewise, you can scale and shift the output, if desired: $c\sigma(ax +b)+d$. If this isn't flexible enough, you need to explain how & why in detail. $\endgroup$
    – Sycorax
    Commented Nov 14, 2022 at 23:36

0

Browse other questions tagged or ask your own question.