Path: news.mathworks.com!not-for-mail
From: "Arvind Iyer" <aiyer@ict.usc.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Implementing smoothing splines
Date: Tue, 16 Dec 2008 01:14:02 +0000 (UTC)
Organization: Institute of Creative Technologies
Lines: 71
Message-ID: <gi6vcq$7mo$1@fred.mathworks.com>
References: <gg02be$av0$1@fred.mathworks.com> <see-B34D00.23454718112008@news.frontiernet.net> <gg43p9$66m$1@fred.mathworks.com> <see-35BF30.16241020112008@news.frontiernet.net>
Reply-To: "Arvind Iyer" <aiyer@ict.usc.edu>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229390042 7896 172.30.248.37 (16 Dec 2008 01:14:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 16 Dec 2008 01:14:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1412562
Xref: news.mathworks.com comp.soft-sys.matlab:507206


Are there important performance limits of these spline functions (from the File Exchange) which limit their applicability?

For instance, do these functions optimally choose the number of breaks when the user does not specify them? Is uniformly sampled data preferably required for these spline functions to perform well?

If indeed these are the limitations of the File Exchange spline functions, do the functions in the MATLAB spline toolbox address them adequately?


Doug Schwarz <see@sig.for.address.edu> wrote in message <see-35BF30.16241020112008@news.frontiernet.net>...
> [top posting repaired]
> 
> In article <gg43p9$66m$1@fred.mathworks.com>,
>  "Arvind Iyer" <aiyer@ict.usc.edu> wrote:
> 
> > Doug Schwarz <see@sig.for.address.edu> wrote in message 
> > <see-B34D00.23454718112008@news.frontiernet.net>...
> > > In article <gg02be$av0$1@fred.mathworks.com>,
> > >  "Arvind Iyer" <aiyer@ict.usc.edu> wrote:
> > > 
> > > > I need to fit smoothing splines to very noisy data.
> > > > 
> > > > I do not have the Spline Toolbox (whose 'spaps' function is recommended 
> > > > for 
> > > > such problems.)
> > > > 
> > > > How can smoothing splines be implemented with other MATLAB functions? The 
> > > > ordinary 'spline' function simply 'joins the dots' and does not perform 
> > > > smoothing. 
> > > > 
> > > > What other inbuilt function can serve a similar purpose? Are there 
> > > > functions 
> > > > which perform generalized regression without the need to specify a 
> > > > functional 
> > > > form of regression function?
> > > 
> > > 
> > > Perhaps spfit from the FEX would be useful.
> > > 
> > > <http://www.mathworks.com/matlabcentral/fileexchange/13812>
> > > 
> > > 
> > > You might find a general purpose smoothing routine helpful, also.
> > > 
> > > <http://www.mathworks.com/matlabcentral/fileexchange/17986>
> >
> > Thank you that helped.
> > 
> > I had a couple of follow-up questions.
> > 
> > You've suggested spfit and supersmoother...When is one preferred over the 
> > other? (I have data with noise of very high variance.)
> 
> In my experience, smoothing can be very subjective.  You need to use 
> both tools and see which one seems better to you.  Objectively, 
> supersmoother has the advantage that there are no parameters to set so 
> if you have trouble knowing where to place the knots in spfit you might 
> like that.  But you must try them on *your* data.
> 
> > Also, can the user somehow modify the number of 'pieces' in the spline fit? I 
> > ask this because, for my data, the outputs of spfit look way too much like 
> > straight lines. Is this something one lives with (I haven't used splines 
> > before) or should we alter the options to get 'curvier' splines?
> 
> Yes, read the help for spfit.  You can place the knots wherever you like 
> and you can even accommodate known features (like a sharp change in 
> slope).  It's been a while since I used spfit so I don't recall all the 
> options.
> 
> -- 
> Doug Schwarz
> dmschwarz&ieee,org
> Make obvious changes to get real email address.