On checking the convexity of a multivariate function.

102 Views Asked by At

I want to check the convexity of the following multivariate function:

$$K(Q, s) = h\frac{(Q-s)^2}{2Q}+b\frac{s^2}{2Q}+\hat{b}\frac{s\lambda}{Q}+K\frac{\lambda}{Q} +c\lambda,$$ where $Q>0$, $s \ge 0$ and $h, b, \hat{b}, c, \lambda, K > 0$ and are known.

I want to know/prove that this function is convex.

Calculating the Hessian matrix of $K$, I get

$$ \begin{bmatrix} \frac{s^2(h+b)+2\hat{b}s\lambda+2K\lambda}{Q^3} & -\left(\frac{s(h+b)+\hat{b}\lambda}{Q^2}\right)\\ -\left(\frac{s(h+b)+\hat{b}\lambda}{Q^2}\right) & \frac{h+b}{Q}\\ \end{bmatrix}. $$

I did some tests:

  • I calculated $x^TAx$, where $x$ $\in \mathbb{R}^2$ and $A$ is my Hessian matrix. I got, after simplification:

$$x^TAx = \frac{x_1^2\left(s^2(h+b)+2\hat{b}s\lambda+2K\lambda\right)}{Q^3}-\frac{2x_1x_2Q(s(h+b)+\hat{b}\lambda)}{Q^3}+\frac{x_2^2Q^2(h+b)}{Q^3}$$

\begin{align} &=\frac{(h+b)}{Q^3}\Big(x_1s-x_2Q\Big)^2+x_1^2\frac{2K\lambda}{Q^3} + x_1^2\frac{2\hat{b}s\lambda}{Q^3}-\frac{2x_1x_2\hat{b}Q\lambda}{Q^3}. \end{align}

But I can quickly find a combination of parameters that leads to a negative number.

  • I also looked at the determinant. We can see that $$\det A = \frac{2K\lambda(h+b)-(\hat{b}\lambda)^2}{Q^4}$$, which is definitely not always $\ge 0$.

So, there must exists an eigenvector such that $x^TAx = \frac{2K\lambda(h+b)-(\hat{b}\lambda)^2}{Q^4}\|x\|^2<0$.

  • Lastly, the diagonal elements are positive, but the matrix is not diagonally dominant, because I can find a combination of parameters that leads to

$$\frac{s^2(h+b)+2\hat{b}s\lambda+2K\lambda+Q^2(h+b)}{Q^3} < \frac{2s(h+b)+\hat{b}\lambda}{Q^2}$$

This all points out that the function is non-convex, but when I calculated $K(Q, s)$ for several parameter combinations to check all kinds of possible cost functions, I didn't find a non-convex one there. So, this makes me doubt.

So, the question is if I missed something or if I do did my calculations correctly and the function is simply non-convex, but it's hard to find a counter example?

Also, what test(s) of these 3 are completely redundant when checking for convexity of a multivariate function? I would think that checking the determinant is enough. Is that correct?