regression (using 3D points cloud dataset) I have a dataset of trajectories. These trajectories are represented in 3D space (x,y,z). All trajectories of this dataset are similar in their shape, but they are not exactly the same, I mean, there is some variation along the points. The trajectories are nonlinear.
What I need is a kind of regression (polynomial?) on the data to fit the curve along the 3D points, at the end I need a smoothed trajectory, say a generalized one (result of curve fitting/regression). 
I just find curve fitting for 2D data (x,y). Can anyone give hints of how to solve it? I heard about local polynomial regression on manifolds, but I dont know how it works, seems to be complex.
thank you in advance
 A: It is not clear what you are looking for.  One approach to smooth each trajectory is a set of splines.  You can just regard each of x, y, and z as functions of time and calculate (for example) a cubic spline.  Section 3.3 of Numberical Recipes has a discussion.  
If you want to combine the trajectories into one "average" trajectory, you have to decide what you want to do.  You could certainly average the x,y,z points of all your trajectories to get an average, then do splines on that.  You probably want to average the points an equal distance or time from the origin.  Alternately, maybe you have some model of what a trajectory should look like (like an elliptical orbit) and you are trying to remove measurement noise.  Then you are in to multidimensional minimization.  You write the equation your points are supposed to satisfy (with adjustable parameters) and adjust the parameters until the error is minimized.  Chapter 10 of the same book can help.
A: Thank you for your hints, I'll check it. Actually I could not attach examples of my dataset, but imagine a set of trajectories in "M" shape. Going through all points of the dataset of trajectories I was intending to fit the data by some kind of regression.
But, probably you are right, by using splines perhaps I can do it. The main idea is: given a set of trajectories, to represent this dataset in a single trajectory, a kind of prototype to match in the future with other trajectories to verify if they are similar.
