title: Curve Fitting 3D data set
body: <p>The curve-fitting problem for 2D data is well known (LOWESS, etc.) but given a set of 3D data points, how do I fit a 3D curve (eg. a smoothing/regression spline) to this data? </p>
  
  <p>MORE: I'm trying to find a curve, fitting the data provided by vectors X,Y,Z which have no known relation. Essentially, I have a 3D point cloud, and need to find a 3D trendline.</p>
  
  <p>MORE: I apologize for the ambiguity. I tried several approaches (I still haven't tried modifying the linear fit) and a random NN seems to work out best. I.e., I randomly pick a point from the point cloud, find the centroid of it's neighbors (within an arbitrary sphere), iterate. Connecting the centroids to form a smooth spline is proving to be difficult but the centroids obtained is passable.</p>
  
  <p>To clarify the problem, the data is not a time series and I'm looking for a smooth spline which best describes the point cloud I.e., if I were to project this 3D spline on a plane formed by any 2 variables, the projected spline (onto 2D) will be a smooth fit of the projected point cloud (onto 2D).</p>
  
  <p>IMG: I've included an image. The red points represent the centroid obtained from the aforementioned method. </p>
  
  <p><a href="http://img510.imageshack.us/img510/2495/40670529.jpg">3D Point Cloud and Local Centroids http://img510.imageshack.us/img510/2495/40670529.jpg</a></p>