sigmoid changing shape
Sophia Terry
The sigmoid function is a function with range (0,1)
$$
y=\dfrac{1}{1+e^{k(x-i)}}
$$
where $k$ controls the steepness of the function and $i$ the value in $x$ where $y=.5$. Setting $k=5$ and $i=2.5$ for instance results in the following function:
I would like to be able to change this function so that it has a different shape depending on x.
Basically I would like to evaluate different versions of this function depending on a user that moves along the x axis. So, if a user is at say $x=20$ I would like the parameters to be $i=10$ and $k=3.3$ The resulting function looks like this:
Evaluating this function for $x'=10$ results in $y=.5$
I want this function to change depending on $x$ so that $i=x/2$. Doing that however changes the function to
$$ y=\dfrac{1}{1+e^{k(x-i)}}\\ = \dfrac{1}{1+e^{k(x-x/2)}}\\ = \dfrac{1}{1+e^{k(x/2)}} $$
which looks like...
evaluating $x'=10$ in this function is now basically 0. Very different from what is desired.
In principle I want to change the function according to where a user is, and then evaluate the position of other objects with respect to this function.
Where am I getting confused? How can I modify a function in this way?
$\endgroup$2 Answers
$\begingroup$You are using $x$ in two ways: One to represent the current position of the user, and another to represent the generic variable $x$ in the sigmoid function. I think you will achieve your desired goal if you use a different variable, say $t$, to represent the current user's position. Then the function you are looking for is $$ y=\dfrac{1}{1+e^{k(x-t/2)}} $$
$\endgroup$ $\begingroup$Too long for a comment, but I am sure a solution can be easily found once some explanations are provided. I am not so sure I understand what you are trying to do, the situation you are trying to model, maybe some context on the application you have in mind might help.
It seems to me that you might be confusing the role of variables and parameters.
In the first case, it seems to me you want that the position of the point $x_0$ such that $y(x_0) = 0.5$ depends on the "user" position: the latter should enter your equation as a parameter then.
In the second case you use your "user" position as a variable, which is a different operation altoghether from the logical point of view. A function maps a variable to an output: for every $x$, we know what $y(x)$ is. In this sense, it seems meaningless to say that the function will depend on the user position, if this is the variable. If $x$ represents the user position, one defines $y$ for each $x$, and that is one function, nothing to modify accoding to there the user is (considered as a variable). It seems to me you are using the user position as a variable, and then want to define a family of functions based on the variable value. Let us know what you are modelling and I will gladly expand upon this, making it far clearer.
$\endgroup$