[R] How to compare contours

Landini Massimiliano numero.primo at tele2.it
Wed Sep 20 12:47:31 CEST 2006


dear All
can anybody point me in to the right direction for this kind of operation??

Here an example.
Please consider an hilly matematical landscapa as

i<-10000

X<- runif(i, min=0, max=4*pi)
Y<- runif(i, min=0, max=4*pi)
Z<-(cos(X)+cos(Y))/2

plot(X,Y,xlim=c(0,4*pi),ylim=c(0,4*pi), xlab="X",ylab="Y", main=c(i,"  points"))
coscos.spl<-interp.new(X,Y
,Z,xo=seq(0,4*pi,length=100),yo=seq(0,4*pi,length=100))
contour(coscos.spl,add=T,col="blue",levels=c(seq(-1,1,1/5)),labcex=0.8)

in this case contour plot derived from 10000 points interpolated rappresent very
welll real trend.
now consider

par(mfrow=c(4,5) )
for (i in seq(5,195,10)) {

X<- runif(i, min=0, max=4*pi)
Y<- runif(i, min=0, max=4*pi)
Z<-(cos(X)+cos(Y))/2

plot(X,Y,xlim=c(0,4*pi),ylim=c(0,4*pi), xlab="X",ylab="Y", main=c(i,"  points"))
coscos.spl<-interp.new(X,Y
,Z,xo=seq(0,4*pi,length=100),yo=seq(0,4*pi,length=100))
contour(coscos.spl,add=T,col="blue",levels=c(seq(-1,1,1/5)),labcex=0.8)
}


How many points are necessary to fit (at 95% c.i.) true surface???
85 points???
or more than  200???

tnx in advance!!



-------------------------------------------------------------------------------------------------------------------------
Landini Massimiliano
-------------------------------------------------------------------------------------------------------------------------
Legge di Hanggi: Più stupida è la tua ricerca, più verrà letta e approvata.
Corollario alla Legge di Hanggi: Più importante è la tua ricerca, meno verrà
capita.



More information about the R-help mailing list