[R] multivariate splines

Tamas K Papp tpapp at Princeton.EDU
Wed Nov 8 22:13:42 CET 2006

On Wed, Nov 08, 2006 at 09:49:50AM -0800, Spencer Graves wrote:
>      You say, "I have looked at a few spline packages in R, but didn't 
> find what I was looking for.  Could somebody please point me in the 
> right direction?"  It's difficult to comment without more information on 
> what you've tried and why you thought it was not adequate.  Please 
> provide commented, minimal, self-contained, reproducible code, 
> explaining very briefly what you've tried and why it did not seem 
> satisfactory (as suggested in the posting guide 
> "www.R-project.org/posting-guide.html").  In case you are not familiar 
> with 'RSiteSearch', I just tried RSiteSearch("multivariate splines"):  
> It produced 45 hits, some of which might interest you. 
>      Hope this helps. 
>      Spencer Graves
> p.s.  I received permission from Paul Dierckx to build an R package 
> using the the software associated with his book, "Curve and Surface 
> Fitting with Splines" (Oxford University Press, 1993).  However, I 
> haven't started on that project, partly because I'm not too familiar 
> with splines and partly for lack of time.  Dierckx's software seems to 
> allow the fitting minimal splines, and I have not found a package in R 
> that supports that. 

Hi Spencer,

Thank you for your answer.  I did the search you suggested (and
others) before posting, and I found many R packages that calculate
various multivariate _smoothing_ splines.

I am not that familiar with spline theory, though currently I am
reading de Boor's Pactical Guide to Splines and the Dierckx book you

What I need is a spline calculated on a multivariate grid, which
allows the computation of interpolated values (and also first and
second derivatives) quickly (calculating the spline itself happens
only once at each iteration, but I need to calculate the actual
values/derivatives many times.  I thought that a pp-form represenation
would allow this.

I asked on the list because not being familiar with splines might mean
that some R packages do provide this capability but I overlooked it.
I need this for dynamic programming, a nice example for the
application of splines in this area is [1].  If smoothing splines
allow the fast calculation of derivatives, they would work too, but I
think that the fitting step is very costly (dimensions for the grid
are something like 10 x 100 x 50) and I don't actually need smoothing.

If I find no R package, I will write the necessary code.  I am
planning to calculate a representation in a tensor B-spline space
first, and then convert to the pp-form (ie calculate the coefficients
of the polynomials from that).



Johnson, S.A., J.R. Stedinger, C.A. Shoemaker, Y.Li, and
J.A. Tejada-Guibert, "Solving Continuous-State Dynamic Programs using
Linear and Spline Interpolation", Operations Research, Vol. 41, No. 3,
484-500, May-June, 1993.

More information about the R-help mailing list