similar to: R equivalent to Matlab spline(x,y,xx)

Displaying 20 results from an estimated 6000 matches similar to: "R equivalent to Matlab spline(x,y,xx)"

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
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
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
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
2010 Mar 06
1
Possible to use array of spline functions for storing data?
Dear listeRs; I am hoping to provide myself the ability to interpolate mortality estimates within intervals for a range of conditions and ages. I have four mortality tables derived from the Society of Actuaries 2001 VBT tables that contains interval mortality rates by starting age and year of duration. I would like to flexibly interpolate using a large set (~4MM) of ages and conditions
2011 Oct 18
0
rls() fails on function calling spline()
Hello everybody I want to use rls() on a multi-dimensional function, where parts of it are modeled using a spline. I tried to condense my problem into the following code example, which tries to fit the y-values of a spline interpolation: --------------------------------------------------------------------------- rm(list=ls(all=TRUE)) x<-c(1,2,3,4,5,6,7,8,9) y<-x^2
2007 Feb 13
4
matlab style plotting in R
Hello I was wondering how I can achieve matlab style plotting in R, in the sense that matlab allows you to plot multiple sets of variables within the same x-y axes. plot in R does not seem to cater for this. I tried 'overplot' from the gplots package but this assumes different y axes for the variables. any suggestions would be very appreciated Maria [[alternative HTML version
2006 Mar 17
1
Derivative of a splinefun function.
Is there a way of calculating the derivative of a function returned by splinefun()? Such a function is a cubic spline, whence it has a calculable derivative, but is there a (simple) way of getting at it? One workaround that I have thought of is to take a fine grid of points, evaluate the function returned by splinefun() at these points, put an interpolating spline through these points using
2012 Dec 01
3
cubic spline
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 value inside the evaluation range. Let's suppose that: 1- *X = [-10, -5, 0, 5, 10]* 2
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?
2009 Jan 08
2
interpolation to abscissa
Readers, I have looked at various documents hosted on the web site; I couldn't find anything on interpolation. So I started r and accessed the help (help.start()). (by the way is it possible to configure r to open help in opera instead of firefox?) Initially I read the help for the akima package but couldn't understand it. Next I tried the asplines package help. I tried to copy the
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
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 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
2005 May 02
2
Restricted cubic spline function ERROR?: glm(Y~rcs(x,5))
Dear all, Is the restricted cubic spline function working properly in the glm model? We used glm(y~rcs(x,5), family=binomial) but it seems that for some theoretical reasons the rcs, restricted cubic spline function can not be fitted by a glm function. Is this correct? Regards, Jan ((Originally, we used lrm(y~ rcs(x,5)) but we couldn't find how to derive the AIC value of the fitted model.
2001 May 14
0
followup: lookup function for density(...) objects
Thanks to Ross Ihaka and Bob Wheeler for responding to my earlier question. I looked into the Johnson system functions in SuppDists package. For now, I want to stick with the density(...) estimator, and so still need the variate lookup function. As per Ross' suggestion, I just did a numerical integration on the density object and used approxfun/splinefun to "lookup" the variate
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
1997 Apr 30
1
R-beta: Re: S Compatibility
Bill Venables writes: > Are the scoping differences between R and S set out precisely and > definitively somewhere? This would be useful. In the source code perhaps? :-) You can find a pretty precise description in the article Robert and I did in JCGS. Actually its pretty simple. Functions have access to the variables which were in effect when the function was defined. f <-
2011 Nov 22
0
plotting output from LME with natural cubic spline
I have used LME to fit a mixed effects model on my data. The data has 274 subjects with 1 to 6 observations per subject. Time is not linearly associated with the outcome, so I used ns to fit a natural cubic spline with 3 auto knots. Subject and the natural cubic time of spline are both treated as random effects. This model has run without any problem, but now I would like to plot trajectories for
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: