1. ## Some further questions about convexity/concavity

I have two questions about convexity:

1)

f(x,y) is a convex function,
are the following functions convex too?
[f(x,y)]2
ln[f(x,y)]
and
e[f(x,y)]

I dont really understand how to answer to this, in my opinion it is clear that they remain convex, but I'm not sure about the correct explaination why.

Secondly:
Is f(x,y)=ln(1-(x-a)2-y2) convex or concave?
"a" stands for a real number.

Can I simply perform the second derivative test on this?
So I set f(x,y)=0 to get stationary points, than I take the second derivative and fill in the stationary points in order to test for convexity?

2. ## Re: Some further questions about convexity/concavity

Proving convexity of a function in general can be a bit of a pain, but there are few tricks.

1. If a function is quadratic, check if the Hessian is positive semidefinite. In that case, the function is convex. For a general function, you technically check this condition at every point, but I typically find that difficult.

2. Frankly, the best way to prove convexity is to see if you can do so constructively. This doesn't always work, but when it does, it's the easiest. Note, let f and g be convex and f be monotonically increasing. Then, $f\circ g$ is convex. In order to see this, notice that

$f(g(\mu x + (1-\mu) y)) \leq f(\mu g(x) + (1-\mu) g(y)) \leq \mu f(g(x)) + (1-\mu)f(g(y))$

where we use convexity in both inequalities and monotonicity of f is the first inequality.

Now, as to your specific functions:

1. $f(x,y)^2$: No. It's easiest to see in one dimension. $x^2-1$ is convex. However, $g(x)=(x^2-1)^2$ is not since $g(-1)=0$, $g(1)=0$, but $g(0)=1$. According to convexity, we need $g(0)\leq0$. Or, simply graph the function and you'll see a bump at the origin.

2. $log(f(x,y))$: No. Let $f(x,y)=x$. Then, we have l $og(f(x,y))=log(x)$, which is actually concave. It's easiest just to graph, but you can verify this by looking at the second derivative of $log(x)$.

3. Yes. $e^x$ is convex and monotonically increasing. $f(x,y)$ is convex. From the composition rule above, the result is convex.

3. ## Re: Some further questions about convexity/concavity

Thank you for the very detailed explaination.

So for the second question if I am asked if f(x,y)=ln(1-(x-a)2-y2) is concave I can say yes, because the second derivative of the log function tells us that it's always concave.

4. ## Re: Some further questions about convexity/concavity

The function $f(x,y)=log(1-(x-a)^2-y^2)$ is actually concave. In order to see this, we use the composition rule. First, log is concave (by looking at the Hessian) and monotonically increasing. Second, $1-(x-a)^2-y^2$ is quadratic with a negative definite Hessian, hence, concave. Therefore, the composition of the two is concave.

5. ## Re: Some further questions about convexity/concavity

Thank you, what would happen if the composition rule would yield a convex function with a concave domain? or vice versa?

6. ## Re: Some further questions about convexity/concavity

Ok, so you may want to check these using the same procedure that I used to prove the convex composition rule above, but I believe it goes as follows

1. f: increasing convex, g: convex, $f\circ g$ convex
2. f: increasing concave, g:concave, $f\circ g$ concave
3. f: decreasing convex, g: concave, $f\circ g$ convex
4. f: decreasing concave, g: convex, $f\circ g$ concave

7. ## Re: Some further questions about convexity/concavity

how can I test if the function is decreasing or increasing?

8. ## Re: Some further questions about convexity/concavity

Sometimes figuring out whether a function is increasing or decreasing can be tricky. One potential trick, in the case of differentiable function, is to verify $f^\prime(x)\geq$ 0 for all x. Alternatively, you can also use composition rules for monotonicity. For example, composing an increasing function with an increasing function with also increasing. Then, constants are both increasing and decreasing and you can work out rules for addition, multiplication, and the like. Note, this doesn't always work, but sometimes it's useful. Finally, you can just do it the old fashioned way and try to prove that $f(x) \leq f(y)$ for $x\leq y$.

9. ## Re: Some further questions about convexity/concavity

I have tried some other examples.

The following functions:

f(x,y)=|x-y|3
This function is neither convex nor concave because it moves into two different directions contemporarly (because of the absolute value). Is this definition true?

f(x,y)=ex2+2y-5
This function is convex (looking at the second derivative).

The function $f(x,y)=log(1-(x-a)^2-y^2)$ is actually concave. In order to see this, we use the composition rule. First, log is concave (by looking at the Hessian) and monotonically increasing. Second, $1-(x-a)^2-y^2$ is quadratic with a negative definite Hessian, hence, concave. Therefore, the composition of the two is concave.
I tried to calculate the Hessian for $1-(x-a)^2-y^2$ but I got a positive definite Hessian of 4 because calculating the second derivatives I get: