n <- 1e3
gauss_sim_data <- rmvnorm(n, numeric(2), matrix(c(1, .8, .8, 1), 2))
laplace_sim_data <- qlaplace(pnorm(gauss_sim_data))
polar1 <- polarise(t(laplace_sim_data))
data1 <- data.frame(radius = polar1$r, angle = polar1$phi[1, ])
fit1 <- geoevgam(data = data1)
# threshold predictions
pred_thresh <- predict(fit1, model = "threshold")
# exceedance predictions on a grid of angles
newdata <- data.frame(angle = seq(0, 2 * pi, length.out = 100))
pred_excess <- predict(fit1, model = "excess",
newdata = newdata, type = "response")
# predictions from both components
pred_both <- predict(fit1,
model = c("threshold", "excess"),
newdata = newdata)
Run the code above in your browser using DataLab