# NOT RUN {
online <- interactive()
# Example 1: homogeneous components
lambda <- c(250, 300, 180, 400)
kappa <- c(30, 25, 20, 25)
omega <- c(0.02, 0.025, 0.03, 0.02)
alpha <- matrix(runif(16, -1, 1), nrow=4, ncol=4)
if(!online) lambda <- lambda/10
X <- rPSNCP(lambda, kappa, omega, alpha)
if(online) {
plot(X)
plot(split(X))
}
#Example 2: inhomogeneous components
z1 <- scaletointerval.im(bei.extra$elev, from=0, to=1)
z2 <- scaletointerval.im(bei.extra$grad, from=0, to=1)
if(!online) {
## reduce resolution to reduce check time
z1 <- as.im(z1, dimyx=c(40,80))
z2 <- as.im(z2, dimyx=c(40,80))
}
lambda <- list(
exp(-8 + 1.5 * z1 + 0.5 * z2),
exp(-7.25 + 1 * z1 - 1.5 * z2),
exp(-6 - 1.5 * z1 + 0.5 * z2),
exp(-7.5 + 2 * z1 - 3 * z2))
kappa <- c(35, 30, 20, 25) / (1000 * 500)
omega <- c(15, 35, 40, 25)
alpha <- matrix(runif(16, -1, 1), nrow=4, ncol=4)
if(!online) lambda <- lapply(lambda, "/", e2=10)
sapply(lambda, integral)
X <- rPSNCP(lambda, kappa, omega, alpha, win = bei$window, dimyx=dim(z1))
if(online) {
plot(X)
plot(split(X), cex=0.5)
}
# }
Run the code above in your browser using DataLab