My Math Forum Least Squares

 Algebra Pre-Algebra and Basic Algebra Math Forum

 June 17th, 2017, 03:17 AM #1 Newbie   Joined: Jun 2017 From: Israel Posts: 1 Thanks: 0 Least Squares Hi, I got this question but I don't know how to solve it: Consider the following optimization problem: sqrt((x1-1)^2+(2*x2+3)^2+x1^2+x2^2-x1*x2) Write down the above problem as the least squares problem and solve it. Last edited by skipjack; June 17th, 2017 at 05:29 AM.
 June 17th, 2017, 06:49 AM #2 Global Moderator   Joined: Dec 2006 Posts: 17,903 Thanks: 1381 The image contains $\displaystyle \min_{(x_1,x_2)\in\mathbb{R}^2}\!\!\sqrt{(x_1 - 1)^2 + (2x_2 + 3)^2 + x_1^2 + x_2^2 - x_1x_2}$. $(x_1 - 1)^2 + (2x_2 + 3)^2 + x_1^2 + x_2^2 - x_1x_2 = \frac18((4x_1 - x_2 - 2)^2 + 39(x_2 + \frac{46}{39})^2) + \frac{106}{39}$, which has a minimum value of 106/39 when $x_1 = 8/39$ and $x_2 = -46/39$. Hence the desired minimum value is $\sqrt{106/39}$. Thanks from 123qwerty
June 17th, 2017, 07:00 AM   #3
Senior Member

Joined: Dec 2012
From: Hong Kong

Posts: 853
Thanks: 311

Math Focus: Stochastic processes, statistical inference, data mining, computational linguistics
Quote:
 Originally Posted by Kereny Hi, I got this question but I don't know how to solve it: Consider the following optimization problem: sqrt((x1-1)^2+(2*x2+3)^2+x1^2+x2^2-x1*x2) Write down the above problem as the least squares problem and solve it.
So, the first thing I did was to simply expand everything and get rid of those pesky brackets:

$\displaystyle \sqrt{2x_1^2 + 2x_1 + 5x_2^2 + 12x_2 -x_1x_2 + 10}$

The most annoying thing here, I think, is the 'interaction term' $\displaystyle x_1x_2$. Let's stuff it into a squared expression:

$\displaystyle \sqrt{2x_1^2 + 2x_1 + 5x_2^2 + 12x_2 +(\frac{1}{4} x_1^2 - x_1x_2 + x_2^2) - \frac{1}{4}x_1^2 - x_2^2 + 10}$

now we can simplify:

$\displaystyle \sqrt{\frac{7}{4}x_1^2 + 2x_1 + 4x_2^2 + 12x_2 + (\frac{1}{2} x_1 - x_2)^2 + 10}$

and now, by completing the squares, we have:

$\displaystyle \sqrt{\frac{7}{4}(x_1+\frac{4}{7})^2 - \frac{4}{7}+4(x_2+\frac{3}{2})^2 - 9 + (\frac{1}{2} x_1 - x_2)^2 + 10}$

Then, of course, we ignore the little constant and the square root because we're minimising and YOLO:

$\displaystyle {(\frac{\sqrt 7}{2}x_1+\frac{2}{\sqrt 7})^2 +(2x_2+3)^2 + (\frac{1}{2} x_1 - x_2)^2 }$

And of course this is equivalent to

$\displaystyle \left \|\begin{bmatrix} \frac{\sqrt 7}{2}x_1+\frac{2}{\sqrt 7}\\ 2x_2+3\\\frac{1}{2} x_1 - x_2 \end{bmatrix} \right \|^2$

i.e.

$\displaystyle \left \|\begin{bmatrix} \frac{\sqrt 7}{2} & 0\\0 & 2\\ \frac{1}{2} & -1 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} - \begin{bmatrix} -\frac{2}{\sqrt 7}\\-3 \\ 0\end{bmatrix} \right \|^2$

This is tedious though haha. Probably not the best way to do it - if the question didn't specify a method, I'd just differentiate. (And as usual, I apologise in advance for any mistakes here. I'd actually be surprised if I didn't make any...)

Last edited by 123qwerty; June 17th, 2017 at 07:04 AM.

 Tags optimization, squares

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post Rishabh Number Theory 3 November 12th, 2015 08:49 AM 3uler Calculus 22 August 17th, 2014 03:55 AM Hoempa Math Events 2 December 6th, 2013 01:12 AM ungeheuer Algebra 3 July 3rd, 2013 12:51 PM aaron-math Calculus 3 March 25th, 2012 10:15 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top