Looking for a 3D function that traces positive x and y axes with a parabola

47 Views Asked by At

I'm designing a loss function for an optimization problem.

My requirements for this function are:

  • If only x is small, the function should be small
  • If only y is small, the function should be small
  • If both x and y are large, the function should be large
  • If both x and y are small, the function should be large

In my mind this function looks something like this:

https://imgur.com/gMz7HAa

https://imgur.com/iiVHmut

Note how the function minima avoids the origin to comply with the 4th requirement. The x, and y values will always be positive, so I only care about the first quadrant.

The best I could come up with is $$f(x, y) = \sqrt{(\frac{1}{0.05*x})-y)^6}$$ which results in a function that looks like this

https://i.imgur.com/4mc8rIK.png

https://i.imgur.com/2daiCHX.png

The problem is that the minima gets very "thin" along the y-axis compared to the x-axis.

I'm aware that “large” and “small” are very vague terms. I only need the structure of the function, I can tune its size later myself.

What function can represent what I'm looking for?

1

There are 1 best solutions below

1
On BEST ANSWER

Assuming, you want domain $x,y>0$, by taking logs, you can reword your question as

  • if $x,y>0$ or $x,y<0$, then $f>0$
  • if $x<0,y>0$ or $x>0,y<0$, then $f<0$

From this it's clear that $f=xy$ should work. After taking exponents: $$ f = e^{\log x \log y} $$

enter image description here