data(craterA)
set.seed(4321)
# define restriction area
restrwin <- spatstat.geom::owin(xrange = craterA$window$xrange,
yrange = craterA$window$yrange,
poly = list(x = c(1500, 1500, 2000, 2000),
y = c(2000, 1500, 1500, 2000)))
# create image of observation probability (30% inside restriction area)
wim <- spatstat.geom::as.im(craterA$window, value = 1)
rim <- spatstat.geom::as.im(restrwin, xy = list(x = wim$xcol, y = wim$yrow))
rim$v[is.na(rim$v)] <- 0
oim1 <- spatstat.geom::eval.im(wim - 0.7 * rim)
if (FALSE) {
# perform bootstrap correction
bc1 <- bootcor_restr(ppdata=craterA, cutoff=0.4, numit=100, tol=0.02, obsprobimage=oim1, nxprob=0.1)
bc1
summary(bc1)
plot(bc1)
# determine high-risk zone by weighting the observations
hrzi1 <- det_hrz_restr(ppdata=craterA, type = "intens", criterion = "indirect",
cutoff = bc1$alphastar, hole=NULL, obsprobs=NULL, obsprobimage=oim1, nxprob = 0.1)
# perform bootstrap correction
set.seed(4321)
bc2 <- bootcor_restr(ppdata=craterA, cutoff=0.4, numit=100, tol=0.02, hole=restrwin, nxprob=0.1)
bc2
summary(bc2)
plot(bc2)
# determine high-risk zone by accounting for a hole
hrzi2 <- det_hrz_restr(ppdata=craterA, type = "intens", criterion = "indirect",
cutoff = bc2$alphastar, hole=restrwin, obsprobs=NULL, obsprobimage=NULL, nxprob = 0.1)
}
Run the code above in your browser using DataLab