[R-sig-Geo] Help: CDF plot

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu Oct 21 21:12:39 CEST 2010



On 10/21/2010 08:42 PM, Zia Ahmed wrote:
> 
> 
> 
> I want to write a R- function to make a CDF plot of all realizations
> (sim1, sim2, sim3........) with CDF of observed data (suppose zinc of
> muse data). Help will be appreciated

It can be me, but after reading your wish several times, I still don't
understand what you want. Do you want to make a cdf plot of each
realization?

plot(ecdf(lzn.sim[[1]])) # etc

Or for each location over all realizations? For threshold z:

z = 5.0
nsim = 6
lzn.sim$z = apply(as.data.frame(lzn.sim)[-(1:2)] <= z, 1, sum)/nsim
spplot(lzn.sim["z"])

Or of the observed values?

plot(ecdf(meuse$zinc))

> Thanks
> Zia
> 
> library(gstat)
> 
> data(meuse)
> 
> data(meuse.grid)
> 
> coordinates(meuse) = ~x + y
> 
> coordinates(meuse.grid) = ~x + y
> 
> lzn.vgm <- variogram(log(zinc) ~ 1, meuse)
> 
> lzn.fit <- fit.variogram(lzn.vgm, model = vgm(1, "Sph", 900, 1))
> 
> lzn.sim <- krige(log(zinc) ~ 1, meuse, meuse.grid, v.fit, nsim = 6, nmax
> = 40)
> 
> /lzn.sim at data <- exp(lzn.sim at data)/
> 
> / /
> 
> 
> / /
> 
> 
> 
> 
> 
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list