lecdf | R Documentation |
Transform data by removing the trend from them and convert them to
local e.c.d.f. (empirical cumulative distribution function).
Each element of y
gets transformed into a number in the unit interval,
values near 0
represent relatively low values of y
(in
the context of their neighbourhood), values near 1
represent
relatively high values of y
.
lecdf(x, y, bandwidth = 0.2)
x |
vector of x-coordinates |
y |
vector of y-coordinates |
bandwidth |
|
A vector of local quantiles.
Tomas Sieger
set.seed(1)
n<-100
x<-runif(n,0,10)
y<-sin(x)+runif(n)
layout(rbind(1,2))
# color points according to their vertical position
# considering their local neighbourhood
l<-lecdf(x,y,bandwidth=.1)
plot(x,y,pch=19,col=topo.colors(100)[rank(l)],main='bandwidth=.1')
# use larger bandwidth
l<-lecdf(x,y,bandwidth=.5)
plot(x,y,pch=19,col=topo.colors(100)[rank(l)],main='bandwidth=.5')
layout(1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.