[R] Calculate x-values from a spline

Cuvelier Etienne ecu at info.fundp.ac.be
Fri Jul 28 14:31:37 CEST 2006


Gunther Höning a écrit :
> Hello,
> 
> I calculate splines from messured points(x,y) of an unknown function f(x).
> e.g.
> x <- c(0.004115, 0.012345, 0.037037, 0.111110, 0.333330, 1.000000)
> y <- c(37, 50, 45, 60, 50, 66)
> w <- c(0.8540541, 0.8320000, 0.8822222, 0.7983333, 0.8220000, 0.8151515) as
> weights
> f <- smooth.spline(x,y,w)
> 
> Now I have y-values and want to calculate the x-value(s) from this spline.
> There is no further limitation to the spline, like monotonicity or anything
> else..
> 
> Does anyone know how to do this ?

Perhaps this ?

finv = splinefun(f$y,f$x)

> 
> Gunther
> 
> 
> 
> gunther.hoening at ukmainz.de
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 
> 

-- 
===============================================
Cuvelier Etienne
Assistant
FUNDP - Institut d'Informatique
rue Grandgagnage, 21   B-5000 Namur (Belgique)
tel: 32.81.72.49.93    fax: 32.81.72.49.67
===============================================


--



More information about the R-help mailing list