search for: splfun

Displaying 3 results from an estimated 3 matches for "splfun".

2008 Oct 06
1
splinefun gives incorrect derivs when extrapolating to the left (PR#13132)
...ing function for splinefun gives incorrect deriv values when x is= less than the smallest x-value used to create the function (at least in on= e circumstance), but does the correct thing for x greater than the largest = x-value. Here is an example: > x <- 1:10 > y <- sin(x) > > splfun <- splinefun(x,y, method=3D'natural') > > # these should be linear (and are) > splfun( seq(0,1, 0.1) ) [1] 0.5682923 0.5956102 0.6229280 0.6502459 0.6775638 0.7048816 0.7321995 [8] 0.7595174 0.7868352 0.8141531 0.8414710 > > # these should all be the same > splfun( se...
2008 Oct 07
0
splinefun gives incorrect derivs when extrapolating to the (PR#13139)
...of the first knot it should be taken as zero. So the attached patch solves the problem in what some might consider a more elegant manner. :) With the patch "make check FORCE=FORCE" works on my machine and it also solves your example: R> x <- 1:10 R> y <- sin(x) R> R> splfun <- splinefun(x,y, method='natural') R> R> # these should be linear (and are) R> splfun( seq(0,1, 0.1) ) [1] 0.5682923 0.5956102 0.6229280 0.6502459 0.6775638 0.7048816 [7] 0.7321995 0.7595174 0.7868352 0.8141531 0.8414710 R> R> # these should all be the same R> sp...
2008 Oct 07
0
splinefun gives incorrect derivs when extrapolating to the (PR#13138)
...hed patch (against the current SVN version of R) implements the latter strategy. With this patch applied, "make check FORCE=FORCE" passes on my machine. The version of R that is build seems to give the correct answer in your example: R> x <- 1:10 R> y <- sin(x) R> R> splfun <- splinefun(x,y, method='natural') R> R> # these should be linear (and are) R> splfun( seq(0,1, 0.1) ) [1] 0.5682923 0.5956102 0.6229280 0.6502459 0.6775638 0.7048816 [7] 0.7321995 0.7595174 0.7868352 0.8141531 0.8414710 R> R> # these should all be the same R> splf...