# Stretch Logistic Function

How can I manipulate a simple logistic function like this one:

So that the lower bound is at 0, and the (-3, 3) range is roughly doubled and depends on some value (the lower edge of the bounding box as described in the original question)

And then how would I flip the function horizontally, so that it can work for the upper edge of the box?

Maths n00b, sorry

-

## 1 Answer

If you take $y=\text{erf}(x)+1$, that will shift the graph up by 1, so the lower limit is 0 and the upper limit is 2. If you want to keep the upper limit at 1, taking half ($y=\frac{1}{2}(\text{erf}(x)+1)$) will return the upper limit to 1 and keep the lower limit at 0.

If you want to double the input from $(-3,3)$ to $(-6,6)$, halving $x$ will do that, $y=\frac{1}{2}(\text{erf}(\frac{1}{2}x)+1)$. If you then want to move it so that what was at $-6$ is now at $a$, use $y=\frac{1}{2}(\text{erf}(\frac{1}{2}(x-a-6))+1)$. To flip it horizontally, take the opposite of $x$, $y=\frac{1}{2}(\text{erf}(-\frac{1}{2}x)+1)$.

-
Thanks very much, good answer, could you explain why the shift in x means replacing x with x-a-6? – Chimoo Mar 8 '11 at 9:24
@Chimoo: The graph of $y=g(x-h)$ (for some function $g$) is the same as the result of translating the graph of $y=g(x)$ by $h$ to the right. So, $x\rightarrow x-h$ is a translation by $h$ to the right, $x\rightarrow x-6$ translates $6$ to the right, moving what was happening at $-6$ to zero, then $x-6\rightarrow x-6-a$ moves another $a$ to the right, so what was happening at zero is now happening at $a$. – Isaac Mar 8 '11 at 9:28
Good explanation, thanks I'll try that – Chimoo Mar 8 '11 at 9:34