# Vector-argument function minimization

This topic is 674 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey,

I have this function: http://www.HostMath.com/Show.aspx?Code=%0AF(%5Cvec%20v_g)%20%3D%20%5Csum_%7Bi%3D1%7D%5E%7Bn%7D%20(%5Cvec%20v_i%20%5Cvec%20v_i%5ET%20-%20%5Cvec%20v_i%20%5Cvec%20v_g%5ET%20%5Cvec%20v_g%20%5Cvec%20v_i%5ET%20)%0A%5C%5C%0A%5Cvec%20v_i%20%3D%20p_i%20-%20p_g

This is formula for the sum of squared distances of points $p_i$ from a line defined by point $p_g$ and unit direction vector $v_g$.

Now I want to find such $v_g$ unit vector that function $F$ is minimized. How to do so?

##### Share on other sites
The link didn't work for me, but it looks like what you are doing is something like "total least squares" regression: https://en.wikipedia.org/wiki/Total_least_squares

##### Share on other sites

I took solution from here https://www.geometrictools.com/Documentation/LeastSquaresFitting.pdf chapter 2. I find the eigenvalue using numerical power method presented here https://mathsupport.mas.ncl.ac.uk/images/9/9a/Numrcl_detrmntn_eignvl_eignvc.pdf

Thanks for pointing out the total least squares though. I've gone through some "least squares" solutions but none applied to my problem.

I think the total least squares is referenced here http://math.stackexchange.com/questions/701051/how-is-the-derivative-with-respect-to-vector-is-taken-in-linear-regression?rq=1

From what I understand beta vector holds the input points. But what is stored in X matrix and t parameter?

##### Share on other sites

I took solution from here https://www.geometrictools.com/Documentation/LeastSquaresFitting.pdf chapter 2. I find the eigenvalue using numerical power method presented here https://mathsupport.mas.ncl.ac.uk/images/9/9a/Numrcl_detrmntn_eignvl_eignvc.pdf

All that seems correct, although the numerical power method can be very slow in some circumstances.

I think the total least squares is referenced here http://math.stackexchange.com/questions/701051/how-is-the-derivative-with-respect-to-vector-is-taken-in-linear-regression?rq=1
From what I understand beta vector holds the input points. But what is stored in X matrix and t parameter?

That looks like standard least squares to me, where you measure errors vertically.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632998
• Total Posts
3009808
• ### Who's Online (See full list)

There are no registered users currently online

×