Least Squares Solution

dmurdoch

New member
Joined
Jul 13, 2020
Messages
6
My machine learning text book tells me that I can perform this transformation by "multiplying out the brackets". Can someone show the intermediary steps for this please?

1594674704638.png

David
 
My machine learning text book tells me that I can perform this transformation by "multiplying out the brackets". Can someone show the intermediary steps for this please?

View attachment 20422

David
Looks good to me. I'd do the terms a bit different, though.
[math](a + b + c)^2 = a^2 + b^2 + c^2 + 2ab + 2ac + 2bc[/math]
I just find it easier to remember all the terms this way.

-Dan
 
Looks good to me. I'd do the terms a bit different, though.
[math](a + b + c)^2 = a^2 + b^2 + c^2 + 2ab + 2ac + 2bc[/math]
I just find it easier to remember all the terms this way.

-Dan

Thanks Dan, your summary makes sense for keeping track of the terms left to right. Appreciated.
David
 
My machine learning text book tells me that I can perform this transformation by "multiplying out the brackets". Can someone show the intermediary steps for this please?

View attachment 20422

David
No one has actually shown the intermediate steps yet, so I will. To make it easier to type, I'll change the names of the variables:

[MATH](t - (u + vx))^2 = t^2 - 2t(u + vx) + (u + vx)^2[/MATH]​
[MATH]= t^2 - 2tu - 2tvx + u^2 + 2uvx + (vx)^2[/MATH]​
[MATH]= t^2 - 2ut - 2vxt + u^2 + 2vxu + v^2x^2[/MATH]​
[MATH]= v^2x^2 + 2 vxu - 2vxt + u^2 - 2ut + t^2[/MATH]​

That's the (rather odd) order they put the answer in. Can you follow the steps?
 
Thanks yes that helps. I think part of the reason they put it in that order is because on the next step they simplify...

[MATH]...2vxu - 2vxt...[/MATH]
to

[MATH]...2vx(u-t)...[/MATH]
Thanks again.
 
Thanks yes that helps. I think part of the reason they put it in that order is because on the next step they simplify...

[MATH]...2vxu - 2vxt...[/MATH]
to

[MATH]...2vx(u-t)...[/MATH]
Thanks again.
Interestingly, if you knew that factoring would be useful, you might want to start out with:

[MATH](t - (u + vx))^2 = ((t-u) - vx)^2[/MATH]​

and expand in that form!

But I like topsquark's approach more in general. A lot depends on your specific goals.
 
Top