| predict.geoevgam | R Documentation |
Generates predictions from the threshold and/or exceedance components of a
fitted geoevgam model. This is a convenience wrapper around the
corresponding predict() methods for the underlying fitted
evgam objects.
## S3 method for class 'geoevgam'
predict(object, model = c("threshold", "excess"), ...)
object |
An object of class |
model |
Character vector specifying which component(s) to predict from.
Possible values are |
... |
Additional arguments passed to the underlying
|
If a single model component is requested, the corresponding prediction
object returned by predict.evgam(). If multiple components are
requested, a named list containing predictions for each requested model
component.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.