Help: CDF plot
On 10/21/2010 09:27 PM, Zia Ahmed wrote:
Thanks again. I want to create a plot with cdf of all realizations overlay with observed cdf value just for comparing the distribution of all realizations with observed data (instead of histogram). I have already done threshold part. I sed 1st, 5th and 9th decile values as thresholds. Thanks Zia
maybe this? It compares the first realisation to those of the observations: qqplot(lzn.sim$sim1, log(meuse$zinc)) abline(0,1) It's of course questionable in the first place whether these two distributions _should_ be equal!
On 10/21/2010 3:12 PM, Edzer Pebesma wrote:
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