# 3D Line of Best Fit

• May 27th 2011, 09:57 AM
Halty
3D Line of Best Fit
I want to draw a line of best fit through some data points in 3D space I have made a few attempts such as averaging the slopes and intercepts for each axis from regular, 2D, simple linear regression however none have turned out very well. Google isn't bringing up very much either.

Any suggestions?

Thanks.
-Halty
• May 27th 2011, 10:32 AM
TKHunny
Look up "multi-linear regression", "normal equations", and "least squares".
• May 27th 2011, 11:35 AM
bryangoodrich
Normally in 3D you would produce a regression plane, but it makes sense to also ask if we cannot fit a line in the same manner as in 2D. I did a quick Google search. The "Math Doctor" says its the 3D Orthogonal Distance Regression (ODR) line. See the link for more details, or Google ODR for more.
• Sep 14th 2011, 12:06 AM
JJacquelin
Re: 3D Line of Best Fit
Quote:

I want to draw a line of best fit through some data points in 3D space I have made a few attempts such as averaging the slopes and intercepts for each axis from regular, 2D, simple linear regression however none have turned out very well. Google isn't bringing up very much either.
Any suggestions?
Try the computation process (non-recursive) detailed pages 9-10 in the paper "Regressions et trajectoires en 3D." The link is :
Scribd
The first part of the paper (in English) deals with 3d. orthogonal linear regession.
The second part (still in French) deals with 3d. orthogonal planar regression (which is not in the scope of the present thread).
• Sep 24th 2011, 01:52 AM
Halty
Re: 3D Line of Best Fit
Wow, very nice. Just took a quick glance and yes this was exactly what I was looking for. Thankyou very much, the work I needed it for is done now but I'll no doubt need it again. I'll take a proper look next week when I'm less busy.

Thanks again.
-Halty