# How can I know this simple quadratic function is a convex function?

Sorry.I don't know enough about convex optimization.
How can I know this function for the $\theta$ vector
$(\theta_0+\theta_1x_1+\theta_2x_2-y_0)^2$
is a convex function?
The other variables are arbitrary constants.

-
If you will rewrite it with no brackets, you will realize, that there are term only of the order 1 and 2. That means that the function is quadratic. Maybe I just didn't understand your question? – Dmitry Laptev Jun 13 '12 at 14:34
I'm asking why its convex on theta @JohnSmith – cloudygoose Jun 13 '12 at 14:36
Oh, yeah I has a mistake in my question @JohnSmith – cloudygoose Jun 13 '12 at 14:39
I still can make no sense of the question (perhaps my bad, though): what is $\,\theta\,$ and where does it appear in the question? What are $\,x_1\,,\,x_2\,,\,y_0$? What's the domain and what the range of this assumed function?? – DonAntonio Jun 13 '12 at 14:41

The function $f(\theta) = \theta_0+\theta_1x_1+\theta_2x_2-y_0$ is linear, and the function $\phi(t) = t^2$ is convex. It is straightforward to show the composition is convex. Suppose $\lambda \in [0,1]$:
$$\phi(f(\lambda x +(1-\lambda)y)) = \phi(\lambda f(x)+(1-\lambda)f(y)) \leq \lambda \phi(f(x)) + (1-\lambda)\phi(f(y)).$$
If a function $x \in \mathbb{R}^n \mapsto f(x) \in \mathbb{R}$ is convex then a function $y \in \mathbb{R}^m \mapsto f(Ay + b) = g(y)$ is also convex for any matrix $A \in \mathbb{R}^{n \times m}$ and any vector $b \in \mathbb{R}^n$ because $$g(\alpha y' + (1-\alpha)y'') \equiv f(A(\alpha y' + (1-\alpha)y'') + b) = \\ = f(\alpha(Ay' + b) + (1-\alpha)(Ay''+b)) \leqslant \alpha f(Ay'+b)+(1-\alpha)f(Ay''+b) = \\ = \alpha g(y') + (1-\alpha)g(y'').$$ In your case function $f(x) = x^2$ is convex because $f''(x) = 2 > 0$, $A = (1,x_1,x_2)$, $b = -y_0$.