Thread View: sci.math.num-analysis
2 messages
2 total messages
Started by Louis G. Stern
Thu, 15 Oct 1992 16:23
Least Squares Fitting or Cubic Splines?
Author: Louis G. Stern
Date: Thu, 15 Oct 1992 16:23
Date: Thu, 15 Oct 1992 16:23
25 lines
1852 bytes
1852 bytes
I'm posting this problem for a friend, and I don't have easy access to usenet, so please reply by e-mail. I will post a summary of the replies. The problem: I have some reasonably good data, 2 pi periodic, which indicates where, on the inside of a tube, there are holes and bends. While it is perfectly obvious visually, I'd like to fit the data with a fairly smooth curve that does *not* incorporate the holes, but *does* capture most of the bends. I have tried one approach: a least-squares fit of the data to the first 5 cos/sin frequencies, then weighting the data inversely as their distance from the fit and trying again. After several iterations most of the outliers are not counted in the fit. This doesn't work so well when the pipe is bent, though, because the cross section of a bent pipe incorporates a lot of high frequency information! The other idea is this: is there some way to pick a 'sufficient' number of control points in the data automatically, without including the outliers (such as might arise from pits in the pipe), and generate a cubic or exponential spline that fits well with the rest of the data? Has anyone come across some combination of splines + least-squared fitting before? I would appreciate references to articles, textbooks, et al. L.G. 'Ted' Stern lstern@orville.nas.nasa.gov
Re: Least Squares Fitting or Cubic Splines?
Author: W.A.B.Evans
Date: Fri, 16 Oct 1992 21:49
Date: Fri, 16 Oct 1992 21:49
27 lines
2100 bytes
2100 bytes
In article <LSTERN.92Oct15162328@orville.nas.nasa.gov> lstern@orville.nas.nasa.gov (Louis G. Stern) writes: > Stuff Deleted > > Has anyone >come across some combination of splines + least-squared fitting before? > In developing a plotter algorithm for my PLOT program, I implemented a piecewise least squares fit of cubic polynomials to the "local" data. The usual least squares algorithm was subject to 2 constraints i.e. the cubic had to be continuous in value and gradient with the previous cubic - as indeed are cubic splines. These constraints are coded by means of Lagrange multipliers - so that to obtain the next cubic, I had to invert a 6x6 matrix (instead of the usual 4x4). The first 4 elements of the 6-vector are the cubic coeffs one desires and the last two are the Lagrange multipliers that are of no further use. To start it off, I do a normal unconstrained cubic fit to the leftmost local data - so that this technique is not as nicely symmetric as a normal cubic spline. I also used a "Lorentzian" weighting function to weight the "local" points the width of which I could choose. For narrow widths the piecewise polynomial fit curve makes valiant efforts to pass very close to every point (like cubic splines) but for larger widths it produces a smoother curve that ignores high frequency (noise?) in the data. Although this technique is fairly "obvious" I have never seen any textbook refer to it - but I dare say someone out there may know better. Regards, W. Alan B. Evans [ wabe@ukc.ac.uk ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads