This function is called by the pred_pred module and calls disaggregation::predict_model() and disaggregation::predict_uncertainty() and also generates predicted cases. SpatRasters are wrapped to enable asynchronous operation.
pred_pred(
fit,
cases = FALSE,
aggregation = NULL,
predict_iid = FALSE,
uncertain = FALSE,
N = 100,
CI = 0.95,
async = FALSE
)
disag_model. Object returned by disag_model function that contains all the necessary objects for generating predictions.
logical. Whether to predictions of cases. Default FALSE
SpatRaster. The aggregation raster. Default NULL
. Must be
supplied if cases
is TRUE
.
logical. Whether to generate predictions including the iid effect
logical. Whether or not to generate upper and lower credible intervals
numeric. The number of realisations to use when generating uncertainty
predictions. Default 100
numeric. The credible interval to user when generating uncertainty
predictions. Default 0.95
logical. Whether or not the function is being used asynchronously
a list containing the predictions
common <- readRDS(system.file("extdata", "fit-minimal.rds", package = "disagapp"))
common$fit$data$covariate_rasters <- unwrap_terra(common$fit$data$covariate_rasters)
prediction <- pred_pred(common$fit)