Re: [R] cubic spline

2012-12-03 Thread Martin Maechler
Ben Bolker bbol...@gmail.com on Sat, 1 Dec 2012 21:49:47 + writes: Martin Maechler maechler at stat.math.ethz.ch writes: [snip] but definitely *no* need to use a function from an extra CRAN package .. as someone else ``erronously'' suggested. Note that

Re: [R] cubic spline

2012-12-02 Thread Hans W Borchers
but definitely *no* need to use a function from an extra CRAN package .. as someone else ``erronously'' suggested. Except that Matlab's interp1() 'cubic' method does not use cubic spline interpolation, but Moler's 'pchip' approach, a piecewise cubic Hermite interpolation. Thus the results are

Re: [R] cubic spline

2012-12-02 Thread Steve Stephenson
Dear all, many thanks for your answer and support!! Steve -- View this message in context: http://r.789695.n4.nabble.com/cubic-spline-tp4651537p4651698.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] cubic spline

2012-12-01 Thread Steve Stephenson
Hallo, I'm facing a problem and I would really appreciate your support. I have to translate some Matalb code in R that I don't know very well but I would like to. I have to interpolate 5 point with a cubic spline function and then I expect my function returns the Y value as output a specific X

Re: [R] cubic spline

2012-12-01 Thread Jorge I Velez
Hi Steve, Check the splint function in the fields package. HTH, Jorge.- On Sat, Dec 1, 2012 at 11:09 PM, Steve Stephenson wrote: Hallo, I'm facing a problem and I would really appreciate your support. I have to translate some Matalb code in R that I don't know very well but I would like

Re: [R] cubic spline

2012-12-01 Thread Steve Stephenson
Hi Jorge, many thanks for your suggestion! I tried the function you mentioned and it looks working!! Now I have just to check that splint (R) and interp1 (Matlab) functions provide me the same results. Kind regards! Steve -- View this message in context:

Re: [R] cubic spline

2012-12-01 Thread David Winsemius
On Dec 1, 2012, at 5:09 AM, Steve Stephenson wrote: Hallo, I'm facing a problem and I would really appreciate your support. I have to translate some Matalb code in R that I don't know very well but I would like to. I have to interpolate 5 point with a cubic spline function and then I

Re: [R] cubic spline

2012-12-01 Thread Martin Maechler
David Winsemius dwinsem...@comcast.net on Sat, 1 Dec 2012 09:25:42 -0700 writes: On Dec 1, 2012, at 5:09 AM, Steve Stephenson wrote: Hallo, I'm facing a problem and I would really appreciate your support. I have to translate some Matalb code in R that I don't know very

Re: [R] cubic spline

2012-12-01 Thread Ben Bolker
Martin Maechler maechler at stat.math.ethz.ch writes: [snip] but definitely *no* need to use a function from an extra CRAN package .. as someone else ``erronously'' suggested. Note that spline() and splinefun() together with approx() and approxfun() are among the several hundred

[R] Cubic spline in nonlinear optimisation

2011-11-16 Thread Simon Hoyle
How can I specify 'starting values' for a cubic spline ns()? I need starting values for all pars when fitting using the nonlinear least squares optimiser nls(). The y variable (length) is a function of 2 variables: alpha and age. The functional form for the age-length relationship is specified as