Statisics - linearity and best-fit in 3 dimensions

Click For Summary
The discussion centers on analyzing a set of 3D data points (X, Y, Z) to determine if they exhibit linearity, find a line of best fit, and assess if this line is parallel to any axes. The use of Pearson's R for testing linearity is debated, with suggestions to conduct multiple tests or apply linear regression techniques. The goal is to detect linear motion for gesture recognition, specifically identifying outward and inward movements along defined axes. The conversation emphasizes the need for clarity in defining gestures and the importance of empirical methods in statistical analysis. Ultimately, the focus is on developing an algorithm to facilitate gesture detection based on linear motion in a 3D space.
  • #31
Let's discuss an utterly simple method. Perhaps objections to it will clarify the problem further.

Let the data points be (x_i,y_i,z_i,t_i) for i = 1 to N. If this data represented a line perfectly parallel to the y-axis then the x and z values would remain constant while the y value varied.

If we have data from an imperfect line, we could estimate the line that the data is "trying to" follow in various ways. The simplest seems to be to estimate that the \hat{x} = the average of the x values in the data and \hat{z} = the average of the z values.

We can quantify the "error" that the imperfect data has in various ways. The one that comes to my mind first

\hat{\sigma^2} = (\frac{1}{N}) { \sum_{i=1}^N ( (\hat{x} - x )^2 + (\hat{z}-z)^2)}

Of course the idea is to classify the data as a gesture parallel to the y-axis when \hat{\sigma^2} is "small". What constitutes a small or large error would have to be determined empirically. You'd have to do a different test for each axis, but this is not an elaborate computation.

One weakness of this method is that it doesn't give any more credit to data that is a perfect straight line but slightly out-of-parallel vs data that is scattered. Is this weakness the reason that you are considering sophisticated statistical methods?
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
Replies
14
Views
11K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
1
Views
2K
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K