[R-sig-Geo] How do I calculate the proportion of simulated values exceeding a particular thresh values?

Zia Ahmed zua3 at cornell.edu
Fri Mar 19 19:23:31 CET 2010


Hi all,

After CSGS realization, I like to calculate  proportion of simulated 
values exceeding a particular thresh values.(Suppose in a prediction 
grid,  out of ten realizations,   in five realizations- simulated value 
exceed  a target threshold value,  here proportion is 0.5). I want  all 
calculate this proportion in all by prediction grid. If some help me 
write the code - it will help me a lot. Here meuse data example:
Thanks


library(gstat)
data(meuse)
data(meuse.grid)
coordinates(meuse) = ~x + y
coordinates(meuse.grid) = ~x + y

# Variogram log Zn

lzn.vgm = variogram(log(zinc) ~ 1, meuse)
lzn.fit = fit.variogram(lzn.vgm, model = vgm(1, "Sph", 900, 1))

#Conditional simulation

nsim = 10
lzn.sim = krige(log(zinc) ~ 1, meuse, meuse.grid, model = lzn.fit, nmax 
= 30, nsim = nsim)

# target values.
###########
target.zn <- log(100)




-------------- next part --------------
A non-text attachment was scrubbed...
Name: zua3.vcf
Type: text/x-vcard
Size: 281 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20100319/f201c892/attachment.vcf>


More information about the R-sig-Geo mailing list