[R-sig-Geo] Help: CDF plot
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Fri Oct 22 11:36:31 CEST 2010
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
More information about the R-sig-Geo
mailing list