Displaying 20 results from an estimated 5000 matches similar to: "Derivative of a splinefun function."
2008 Oct 06
1
splinefun gives incorrect derivs when extrapolating to the left (PR#13132)
This is a low priority bug that has been around for a while, but I came acr=
oss it again while alpha testing 2.8.
The resulting 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
>
2002 Sep 09
1
Monotonic interpolation
Has anyone got a function for smooth monotonic interpolation of a
univariate function? I'm after something like the NAG function PCHIM
which does monotonic Hermite interpolation. Alternatively, montononic
cubic spline interpolation.
Please reply directly.
Rob Hyndman
___________________________________________________
Rob J Hyndman
Associate Professor & Director of Consulting
2011 May 27
1
finding derivative of a data series in R
Dear All,
I tried following for getting derivative of a polynomial in R
i<- -10:10
x<-i*i*i+3*i*i+2
fun_spline<-splinefun(i,x)
plot(x,type="l")
lines(x,fx_spline(x, deriv=1), col='green')
lines(x,fx_spline(x, deriv=2), col='green')
Now when I plot
3*i*i + 6*i and 6*i + 6
the plot was not same for first deivative.
where as the 2nd derivative was same
Is this a
2008 Oct 07
0
splinefun gives incorrect derivs when extrapolating to the (PR#13138)
--MP_/Rxf/JAvsQx5JLkhZFc9Jmn4
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
G'day Greg,
On Mon, 6 Oct 2008 19:50:13 +0200 (CEST)
Greg.Snow at imail.org wrote:
> This is a low priority bug that has been around for a while, but I
> came across it again while alpha testing 2.8.
Indeed, that bug must have been around since
1998 May 25
2
RFC: spline / splinefun (etc) amalgamation
At present R has separate functions "spline" and "splinefun". The first
of these carries out spline interpolation of a data set and returns the
interpolated values; the second returns the interpolating function itself
(approx and approxfun are similar).
I would like to combine these into a single function "spline" with
an (optional) argument which determines which
2007 Nov 14
1
problems with splinefun()
I am working with the function: splinefun() ...
When plugging in the variables, I get the function program as if
though having only entered '"splinefun". only way to get the values
is by
spline(xxx,yyy, n=length(xxx)/10, ties = mean)$x and spline(xxx,yyy,
n=length(xxx)/10, ties = mean)$y.
I'm just wondering if there is something wrong with the package or if
I'm doing
2008 Oct 07
0
splinefun gives incorrect derivs when extrapolating to the (PR#13139)
--MP_/kvy20nVajVG/n.8m=_ZjLAX
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
On Tue, 7 Oct 2008 19:31:03 +0800
Berwin A Turlach <berwin at maths.uwa.edu.au> wrote:
> The attached patch (against the current SVN version of R) implements
> the latter strategy. With this patch applied, "make check
> FORCE=FORCE" passes
2010 Feb 15
1
Non-monotonic spline using splinefun(method = "monoH.FC")
Hi,
In my version of R, the stats package splinefun code for fitting a
Fritsch and Carlson monotonic spline does not appear to guarantee a
monotonic result. If two adjoining sections both have over/undershoot
the way the resulting adjustment of alpha and beta is performed can give
modified values which still do not satisfy the required constraints. I
do not think this is due to finite precision
2006 Feb 10
1
3-d splinefun
hello,
is it possible to do something like splinefun(x,y), but with a 3rd
dim?
for example, if i have a 2-dim system like:
x<-1:100
y<-rexp(100,1)
func<-splinefun(x,sort(y))
func(n) # returns interpolated value of y (after sorting) given x=n
# i can check this by:
plot(x,sort(y))
lines(spline(x,sort(y)))
Can i do the same thing with an x,y, and z? i have found the akima
2007 Oct 05
2
Splines
I want to fit a cubic spline of x on y. where :
x
[1] 467 468 460 460 450 432 419 420 423 423
y
[1] 1 2 3 4 5 6 7 8 9 10
using the syntax
spline(y, x)
I got following output :
$x
[1] 1.000000 1.310345 1.620690 1.931034 2.241379 2.551724 2.862069
[8] 3.172414 3.482759 3.793103 4.103448 4.413793 4.724138 5.034483
[15] 5.344828 5.655172
2012 Nov 15
1
create function to solve derivative
Readers,
A data set comprises
A B C
10 6 .2
20 7 .4
30 8 .16
40 9 .0256
My requirement is to obtain the derivative for values of A with
respect to B, create a function in R and plot this derivative against
another variable (e.g. values in column C).
Have searched the mailing list and found reference to a function 'D',
but the help accessed via '?D' and '?deriv' does not
2000 Sep 04
2
bug in spline()? (PR#653)
BUG IN SPLINE()?
Version R-1.0.1, system i486,linux
If the spline(x,y,method="natural") function is given values outside the
range of the data, it does not give a warning. Moreover, the extrapolated
value reported is not the ordinate of the natural spline defined by (x,y).
Example. Let x <- c(2,5,8,10) and y <- c(1.2266,-1.7606,-0.5051,1.0390).
Then interpolate/extrapolate with
2009 Sep 24
1
basic cubic spline smoothing
Hello,
I come from a non statistics background, but R is available to me,
and I needed to test an implementation of smoothing spline that I have
written in c++, so I would like to match the results with R (for my unit
tests)
I am following
http://www.nabble.com/file/p25569553/SPLINES.PDF SPLINES.PDF
where we have a list of points (xi, yi), the yi points are random such that:
y_i = f(x_i) +
2010 Mar 12
1
Usage of apply function with two matrices
Hello,
I am struggling to overcome following problem:
I have matrix Vf and matrix V, which both have 3 columns and I want to
create a spline function basing on coordinates from this matrices (more
precisely coordinates of function nr 1: x are taken from Vf[,1] and y are
taken from V[,1] respectively), because function apply() base on 1 argument
I made it in this way:
2005 Jul 24
1
Buglet in src/appl/splines.c (PR#8030)
--AZaLVt6Pw+
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit
Dear all,
I was looking at "splinefun" and the underlying C code and believe
that there is a memory access error in the C routine "spline_eval".
Specifically, on line 368 and following the following code appears:
if(ul < x[i] || x[i+1] < ul)
2008 Jun 02
0
Missing "spline_coef" DLL and Rob Hyndmans monotonic interpolator
Hello R help
I have been trying to use Rob Hyndman's monotonically increasing spline
function. But like another user or two seem have a problem with a
missing DLL (namely "spline_coef"). None of the previous help postings
seemed to have any solutions to this problem. As per a Ripley
suggestion I have deleted all previous versions of R and reinstalled R
2.7.0 and the problem
2004 Nov 08
1
how lambda is computed in smoot.spline given _df_
Hi,
I posted some days ago a question concerning the computation of lambda in the smooth.spline function (which I repreat at the bottom of the mail) given _df_ .
Unfortunately the documentation is not clear to me. Maybee someone can help to answer in my view the basic question:
If the penalized log likelihood is L = (y - f)' W (y - f) + lambda c' Sigma c
how the _lambda_ in the above
2010 Feb 18
0
Error in coding for splinefun(method = "monoH.FC") (PR#14215)
Full_Name: Tim Heaton
Version: 2.8.1
OS: linux-gnu
Submission from: (NULL) (143.167.4.162)
Hi,
In my version of R, the stats package splinefun code for fitting a
Fritsch and Carlson monotonic spline does not guarantee a
monotonic result. If two adjoining sections both have over/undershoot
the way the resulting adjustment of alpha and beta is performed can give
modified values which still do
2008 Dec 07
1
custom panel help in lattice
Hi,
I am having an issue with a custom panel for lattice. The problem
comes when I try passing a groups argument.
Here is the custom panel, a wrapper for smooth spline. I copied
panel.loess and replaced the loess arguments with smooth.spline().
[Note: I would like to use the cross-validation fitting properties of
smooth.spline.]
library(lattice)
2009 Mar 31
2
How to generate natural cubic spline in R?
Suppose I have two var x and y,now I want to fits a natural cubic
spline in x to y,at the same time create new var containing the
smoothed values of y. How can I get it?