Displaying 20 results from an estimated 24 matches for "interpspline".
2016 Mar 04
2
R 3.2.4 rc issue
...checking examples ... SKIPPED
* checking tests ...
Running 'spline-tst.R'
ERROR
Running the tests in 'tests/spline-tst.R' failed.
Last 13 lines of output:
> proc.time()
user system elapsed
2.272 0.020 2.291
>
> ###----------------- sparse / dense interpSpline() ---------------------------
>
> ## from help(interpSpline) -- ../man/interpSpline.Rd
> ispl <- interpSpline( women$height, women$weight)
> isp. <- interpSpline( women$height, women$weight, sparse=TRUE)
Error in splineDesign(knots, x, ord, derivs, sparse = sparse) :...
2009 Feb 26
2
interpSpline with dates?
Dear R-helpers,
can I use a POSIXct date as the x variable in interpSpline? The help
page says x and y need to be numeric... is there a workaround?
example:
library(splines)
testdfr <- data.frame(Date=seq(as.POSIXct("2008-08-01"),as.POSIXct("2008-09-01"),
length=10))
testdfr$yvar <- rnorm(10)
sp <- interpSpline(yvar ~ Date, testdfr)
preddfr...
2016 Mar 04
0
R 3.2.4 rc issue
...checking tests ...
> Running 'spline-tst.R'
> ERROR
> Running the tests in 'tests/spline-tst.R' failed.
> Last 13 lines of output:
>> proc.time()
> user system elapsed
> 2.272 0.020 2.291
>>
>> ###----------------- sparse / dense interpSpline() ---------------------------
>>
>> ## from help(interpSpline) -- ../man/interpSpline.Rd
>> ispl <- interpSpline( women$height, women$weight)
>> isp. <- interpSpline( women$height, women$weight, sparse=TRUE)
> Error in splineDesign(knots, x, ord, derivs, sparse =...
2016 Mar 04
1
R 3.2.4 rc issue
...| > Running 'spline-tst.R'
| > ERROR
| > Running the tests in 'tests/spline-tst.R' failed.
| > Last 13 lines of output:
| >> proc.time()
| > user system elapsed
| > 2.272 0.020 2.291
| >>
| >> ###----------------- sparse / dense interpSpline() ---------------------------
| >>
| >> ## from help(interpSpline) -- ../man/interpSpline.Rd
| >> ispl <- interpSpline( women$height, women$weight)
| >> isp. <- interpSpline( women$height, women$weight, sparse=TRUE)
| > Error in splineDesign(knots, x, ord, derivs...
2010 Sep 14
1
predict(backSpline(x)): losing my marbles?
...6, 2.22717964214416, 1.87754657382891,
1.55678176465949,
1.26649764837839, 1.00770187223770, 0.780805622450771,
0.585650849661306,
0.421553364080296, 0.287358347766713, 0.18150469048976,
0.102094654969619
)
plot(d2,r2,type="b")
require(splines)
sp <- interpSpline(r2,d2)
psp <- predict(sp)
points(psp$y,psp$x,col=5)
bsp <- backSpline(sp)
lines(predict(bsp,seq(0,6,length=101)),col=2)
The prediction from the spline (cyan dots) looks perfectly reasonable.
The prediction from the inverted spline matches the curve over part of
the range but
goes...
2006 Jul 31
1
questions regarding spline functions
Greetings,
A couple general questions regarding the use of splines to interpolate depth
profile data.
Here is an example of a set of depths, with associated attributes for a given
soil profile, along with a function for calculating midpoints from a set of
soil horizon boundaries:
#calculate midpoints:
mid <- function(x) {
for( i in 1:length(x)) {
if( i > 1) {
a[i] = (x[i] -
2008 Dec 27
1
contour plot - smooth lines
Dear R-Users,
I am using 'contour' to plot a graph using values x,y and a matrix z.
I would like to obtain 'smooth lines' instead of no-smooth contour lines.
I tried with filled.contour too.
In a Post I found
yy <-predict(interpSpline(x, y))
I could use that method for each range that I want to plot but I hope
to find a easier method.
Thank you
Tommaso Letterio
DIAF - UniFi
Via San Bonaventura 13
Firenze (IT) - 50145
+39-055-3288605
2002 Apr 22
1
predict.*bSpline() bugs extrapolating for deriv >= 1 (PR#1473)
...enough to allow breaking current R-devel's code
freeze. I hope I will have corrected it for 1.5.1..
## Here is code reproducing the problems;
## I use try(.) whenever I know the current versions of R would
## give an error:
library(splines)
x <- c(1:3,5:6)
y <- c(3:1,5:6)
(isP <- interpSpline(x,y))# poly-spline representation
(isB <- interpSpline(x,y, bSpl = TRUE))# B-spline repr.
xo <- c(0, x, 10)# x + outside points
options(digits = 4)
for(der in 0:3) # deriv=3 fails!
print(formatC(try(predict(isP, xo, deriv = der)$y), wid=7,format="f"),
quote = FALSE)...
2004 Sep 13
2
Problem with mle in stats4 (R 1.9.1)
...stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE))
(fit <- mle(ll))
plot(profile(fit), absVal=FALSE)
everything works fine. Now run
(fit <- mle(ll, method="BFGS", control=list(ndeps=c(1e-3, 1e-3))))
plot(profile(fit), absVal=FALSE)
and you will get
Error in interpSpline.default(obj[[i]]$par.vals[, i], obj[[i]]$z,
na.action = na.omit) :
only 0's may mix with negative subscripts
This happens because optim gets the old ndeps but just one variable to
optimize. The optim error is not reported, so the problem is rather hard
to trace. Would you agree that t...
2008 Nov 07
1
Problems with packages fda and splines (PR#13263)
...recently installed the version 2.8.0 of R along with package fda (v
2.0.2)
and its dependencies (including package splines v. 2.8.0).
Here are my problems:
1) The package splines should feature functions such a predict.bs,
predict.bSpline and such and it does not! I can make calls to bs, ns, and
interpSpline but not to any predicting function.
Example:
> library(splines)
> predict.bs
Erreur : objet "predict.bs" non trouv? # in english: object "predict.bs" not
found
Also, I cannot track the package splines on the CRAN website. Why is that?
2) Package fda: it does not handle...
2001 Sep 01
2
interpolation and numerical differentiation in R ?
Hi,
I'm trying to determine if R is useful to me. I've browsed 'The Basics of
S and S-Plus' (Krause & Olson), and like the logic of the language.
However, I don't see an easy way to do things like this:
* given a set of observations (x,y) (x and y equal-length vectors), and a
2nd set of abscissas x2, interpolate y at the new abscissas x2. (for now,
I don't really
2007 Sep 19
3
Smooth line in graph
Hi,
I?m trying to get smooth curves connecting points in a plot using
"spline" but I don?t get what I whant.
Eg.:
x<-1:5
y <- c(0.31, 0.45, 0.84, 0.43, 0.25)
plot(x,y)
lines(spline(x,y))
Creates a valley between the first and second points, then peaks at 3rd,
and another valley between 4th and 5th. I?m trying to get a consistently
growing curve up to the 3rth point and then a
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 Apr 07
3
R-beta: spline problems(?)
Hi,
I am a total beginner with this whole thing so please have patience!
I am trying to run an S-plus program with a certain line:
spline(1:nrow(y), y[,1],n=100);
This crashes with:
Error: NAs in foreign function call (arg 8)
Apparently, this is caused by the last command of spline:
u <- seq(xmin, xmax, length.out = n)
.C("spline_eval", z$method, length(u), x = u, y =
2009 Apr 06
2
approximation function
Hi,
Having a set of values (non-time series data), what are the approximation functions that could determine the trend of the values?
Cheers,
Carol
[[alternative HTML version deleted]]
2002 Nov 04
2
interpolation
Hello,
I have 15 data points (weight at birth) by age which I want to interpolate back
in time (to 5 more age points).
There are many functions in R to do this and I wonder if anyone has experience
in using these -- any preference/caveat etc? I am trying to find an alternative
to linear interpolation.
Using R 1.6.0 under windows
TIA Marwan
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
2002 Feb 11
0
profile
...to profile within that
range only (this is a very crude adjustment, see the code below). The new
profile works, and I can increase the number of points profiled (by changing
delta.t), but for some reason I cannot plot it. I get the following error
message:
Loading required package: splines
Error in interpSpline.default(obj[[i]]$par.vals[,i], obj[[i]]$tau
Thank you for your info
Katarina
My code in full is:
(Note: I'm just using simulated data in this example, and the profile will
sometimes work with this)
# parameter assignments
Nmin <- 0.8852
Nopt1 <- 16.78...
2007 Jul 04
3
Problem/bug with smooth.spline and all.knots=T
Dear list,
if I do
smooth.spline(tmpSec, tmpT, all.knots=T)
with the attached data, I get this error-message:
Error in smooth.spline(tmpSec, tmpT, all.knots = T) :
smoothing parameter value too small
If I do
smooth.spline(tmpSec[-single arbitrary number], tmpT[-single arbitrary number], all.knots=T)
it works!
I just don't see it. It works for hundrets other datasets, but not for
2003 Apr 24
2
R-1.7.0 build feedback: NetBSD 1.6 (PR#2837)
R-1.7.0 built on NetBSD 1.6, but the validation test suite failed:
Machinetype: Intel Pentium III (600 MHz); NetBSD 1.6 (GENERIC)
Remote gcc version: gcc (GCC) 3.2.2
Remote g++ version: g++ (GCC) 3.2.2
Configure environment: CC=gcc CXX=g++ LDFLAGS=-Wl,-rpath,/usr/local/lib
make[5]: Entering directory `/local/build/R-1.7.0/src/library'
>>> Building/Updating