0% found this document useful (0 votes)
78 views

Optimization Convex Concave Example

This document provides examples of concave and convex functions to demonstrate how to determine if a function is concave or convex based on its Hessian matrix and determinant. For the concave example of the function f(x,y) = e^-(x^2+y^2), the determinant of the Hessian matrix is calculated to be negative inside the circle of x^2+y^2<1/2, indicating the function is concave as it has a maximum value inside this region. For the convex example of the function g(x,y) = -e^-(x^2+y^2), the determinant is positive inside the circle, and gxx is positive. This means
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

Optimization Convex Concave Example

This document provides examples of concave and convex functions to demonstrate how to determine if a function is concave or convex based on its Hessian matrix and determinant. For the concave example of the function f(x,y) = e^-(x^2+y^2), the determinant of the Hessian matrix is calculated to be negative inside the circle of x^2+y^2<1/2, indicating the function is concave as it has a maximum value inside this region. For the convex example of the function g(x,y) = -e^-(x^2+y^2), the determinant is positive inside the circle, and gxx is positive. This means
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Optimization-Task 1 (Convex-concave examples)

Mohammad Shojafar
a,
a
Dpt. of Information Engineering, Electronic and Telecommunication, Sapienza University of Rome via Eudossiana
18, 00184 Rome, Italy Tel no. +39 06 44585366 FAX no. +39 06 4873330
1. Samples
1.1. Concave example
Here, we consider function f as follows:
f = e
(x
2
+y
2
)
(1)
f is depended on two variables which are x and y in 3D cartesian space (i.e, x,y,z), and we
want to gure out this function is concave or convex.
We have some steps:
Step 1:
Initially, we produce 2 2 Hessian Matrix below:
(
f
xx
f
xy
f
yx
f
yy
)
So, we calculate its elements:
f
x
= 2xe
(x
2
+y
2
)
(2.1)
f
y
= 2ye
(x
2
+y
2
)
(2.2)
and we can calculate Determinant or (Det) in following:
f
xx
= e
(x
2
+y
2
)
[
4x
2
2
]
(3.1)
f
yy
= e
(x
2
+y
2
)
[
4y
2
2
]
(3.2)
f
xy
= f
yx
= e
(x
2
+y
2
)
[
4xy
]
(3.3)
and with placement these values in Hessian matrix, we have:

Corresponding author
Email address: [email protected] (Mohammad Shojafar)
Preprint submitted to Elsevier June 5, 2014
H = e
(x
2
+y
2
)
(
4x
2
2 4xy
4xy 4y
2
2
)
Step 2:
Now, we need to check the Det of H which is calculated as follows in (4):
Det =
(
(4x
2
2)(4y
2
2)
)
((4xy)(4xy))
= 4 8x
2
8y
2
(4)
Now, we should gure out the sign of the Det, i.e., it is negative or positive.
Step 3:
i) if Det > 0, we are inside the circle (x
2
+ y
2
<
1
2
) in 3-dimension Cartesian space
ii) if Det < 0, we are outside the circle (x
2
+ y
2
>
1
2
) in 3-dimension Cartesian space (i.e,
drop it, we do not care)
Note, We calculate our result except the root (x = 0, y = 0) becasue if we put both of them
zero, therefore Det = 0, so we can not go further!!
Step 4:
We caclulate f
xx
sign in Hessian Matrix:
Check out the function f below in Figure 1:
Note, we drop the case Det < 0 because it is meaningless.
Now, we process the states without pay close attention to the gure 1.
if Det > 0 we have:
i) if f
xx
> 0, we have (4x
2
2 > 0 x
2
>
1
2
): it wont work, because: x
2
+ y
2
<
1
2
and it is
impossible to be in this state while x
2
>
1
2
,
ii) if f
xx
< 0, we have (4x
2
2 < 0 x
2
<
1
2
0 x
2
<
1
2
), so we are inside the circle,
because:x
2
+ y
2
<
1
2
, while 0 x
2
<
1
2
and y
2
is positive, so we have maximum inside the
circle, as a result, f is concave;
In a nutshell, in this case, f
xx
< 0 and Det > 0, function f is Concave (i.e, has Maximum).
1.2. Convex example
g = e
(x
2
+y
2
)
(5)
Because g is depends on just two variables which are x and y in 3D cartesian space, and we
want to gure out this function is concave or convex.
Step 1:
2
Figure 1: f = e
(x
2
+y
2
)
which is concave
Initially, we produce Hessian Matrix.
this matrix is shown:
The Hessian Matrix of the 2 2 matrix
(
g
xx
g
xy
g
yx
g
yy
)
For calculating each element of this matrix, we have:
g
x
= 2xe
(x
2
+y
2
)
(6.1)
g
y
= 2ye
(x
2
+y
2
)
(6.2)
and we can calculate Determinant or (Det) as follow in eqs. (7):
3
g
xx
= e
(x
2
+y
2
)
[
2 4x
2
]
(7.1)
g
yy
= e
(x
2
+y
2
)
[
2 4y
2
]
(7.2)
g
xy
= f
yx
= e
(x
2
+y
2
)
[
4xy
]
(7.3)
and if we put them in the Hessian matrix we have:
H = e
(x
2
+y
2
)
(
2 4x
2
4xy
4xy 2 4y
2
)
Step 2:
Now, we need to check the Det of H which is calculated as follows in (8):
Det =
(
(2 4x
2
)(2 4y
2
)
)
((4xy)(4xy))
= 4 8x
2
8y
2
(8)
Now, we should gure out the sign of the Det, i.e., it is negative or positive.
Check out the function g in Figure 2.
Figure 2: g = e
(x
2
+y
2
)
which is convex
Regardless of the Figure 2, we would like to check-out the gs concavity/convexity.
Step 3:
4
i) if Det > 0, we are inside the circle (x
2
+ y
2
<
1
2
) in 3-dimension Cartesian space
ii) if Det < 0, we are outside the circle (x
2
+y
2
>
1
2
) in 3-dimension Cartesian space (i.e., we
drop this case, becasue it is meaningless!!)
Note, We calculate our result except the root (x = 0, y = 0) becasue if we put both of them
zero, so, it leads to Det = 0 and it is meaningless!!
Step 4:
i) {g
xx
> 0, Det > 0}, we have (2 4x
2
> 0 x
2
<
1
2
0 x
2
<
1
2
): it works, because:
x
2
+ y
2
<
1
2
and it possible to be in this state while 0 x
2
<
1
2
, we can nd some y inside
circle of Det so we have minimum and it is Convex.
ii) {g
xx
< 0, Det > 0}, we have (2 4x
2
< 0 x
2
>
1
2
): it wont work, because:x
2
+ y
2
<
1
2
,
while x
2
>
1
2
and y
2
is positive, so we can say it is impossible to occur.
In a nutshell, in this case, for g
xx
> 0 and Det > 0, function g works and it is convex (i.e, has
Minimum).
5

You might also like