5
$\begingroup$

I am looking for a 2D function, $f(x, y)$ which increases monotonically over the range $(0,0)$ to $(1,1)$. In other words, it will be $0$ at $(0,0)$ and $1$ at $(1,1)$. It will also evaluate to $0$ whenever $x = 0$ or $y = 0$. It's monotonic in the sense that the value at $(0.5,0.6)$ be greater than at $(0.5, 0.5)$. The closest guess that I have to the function that I am looking for is:

Plot3D[1⁄((1+ⅇ^(-x*y))),{x,0,1},{y,0,1}]

But I would also like to be able to "bias" or make the function rise faster with $x$ relative to $y$ or vise-versa. Ideally, I would like to specify the surface with 2 variables. One that controls / scales how $f(x,y)$ rises relative to $x$ and another that controls / scales how $f(x,y)$ rises relative to $y$.

Edit: I am looking for a sigmoid-shaped curve. The function does not need to be exactly equal to 1 at z(1,1). However, z(1,1) to be higher than any other z(x,y) across the space x[0:1], y[0:1]. A closer function than the one above is:

z=1/(1+e^(-(x^a*y^b)) where a and b are used to "bias" or change the slope of the curve with respect to x vs. y. However, that curve is close to 1 at z(2,2) instead of z(1,1). So x and y need to be scaled. Those scaling factors will be a function of a and b. They cannot be computed directly since the exponent needs to be 0 to satisfy the equation exactly. However, if the exponent evaluates to a sufficiently small number, such as 0.01, that should be close enough for my purposes.

$\endgroup$
5
$\begingroup$

Here's a simple example: $f(x,y)=xy$. You can change the powers of $x$ and $y$ to 'bias' one of $x$ or $y$.

Here's another function that is "sigmoid-shaped" and is close to your required values, as per your comments:

$$f(x,y)=\left( \frac{1}{1+e^{-100x+50}}\right)\left( \frac{1}{1+e^{-100y+50}}\right)$$

This is approximately $0$ at $(0,0)$ and $1$ and $(1,1)$, and is sigmoid-shaped in the sense that when either $x=1$ or $y=1$ the resulting slice of the 3D-plot is a sigmoid, as seen here:

enter image description here

Theoretically, you could also make this exactly equal to $1$ at $(1,1)$ and $0$ at $(0,0)$ by multiplying by a constant and changing the values of $50$ in the exponents appropriately to ensure that the function went through the points $(0,0,0)$ and $(1,1,1)$.

$\endgroup$
  • $\begingroup$ That fits my original requirements, but is there another function that also fits the requirements, but has more of a sigmoid shape? For example, z=1/(1+e^(-x^a*y^b)) might be the function that I am looking for, but how do I make it == 1 when x = 1, y = 1? The multiplier constant should be a function of a and b, but not sure how to compute it. $\endgroup$ – PentiumPro200 Jul 10 '14 at 21:49
  • $\begingroup$ Your function won't ever be able to equal to 1 when $x=y=1$ because $e^w$ is never zero, which would be necessary for you to have $z(1,1)=1$. You should add that you want a "sigmoid-shaped curve" to your question. You won't ever be able to get anything that is truly sigmoid-shaped that satisfies the other properties, simply because the horizontal asymptotes $y=0,1$ make this impossible. However, I can give you something "close" if you want. $\endgroup$ – Hayden Jul 10 '14 at 22:20
  • $\begingroup$ I should have mentioned that it does not have to exactly equal 1 at z(1,1). But I would like z(1,1) to be higher than any other z(x,y) across the space x[0:1], y[0:1]. The function that I mentioned above, z=1/(1+e^(-x^a*y^b)), for example with a = 2 and b = 0.9 is approximately equal to 1 at x = 2, y = 2. So z=1/(1+e^(-(x*2)^a*(y*2)^b)) is close enough to 1 at x = 1, y = 1 for a = 2 and b = 0.9. The problem is that the x and y multiplers (which are both 2 in this case) change as a function of a and b. What function did you have in mind that is "close"? $\endgroup$ – PentiumPro200 Jul 10 '14 at 22:55
  • $\begingroup$ @PentiumPro200 I think that you should put in your question exactly what you want. $\endgroup$ – Hayden Jul 10 '14 at 22:57
  • $\begingroup$ @PentiumPro200 see updated answer. $\endgroup$ – Hayden Jul 10 '14 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.