aba_predict {lidaRtRee} | R Documentation |
Mapping of ABA prediction models
Description
Applies calibrated area-based prediction models output of
aba_build_model
to a raster of metrics to obtain a raster of
predictions
Usage
aba_predict(
model_aba,
metrics_map,
stratum = NULL,
add_error = FALSE,
pkg = "terra"
)
Arguments
model_aba |
model returned by |
metrics_map |
raster. metrics returned e.g by
|
stratum |
string. indicates which layer of metrics.map contains the
|
add_error |
boolean. indicates whether errors sampled from a normal distribution
N(0, sigma(residuals)) should be added to fitted values; implemented only for
|
pkg |
raster output format. Use pkg = "terra|raster|stars" to get an output in SpatRaster, RasterLayer or stars format. |
Value
a raster of predictions obtained by applying the model aba_build_model
to the observations in metrics_map
See Also
aba_build_model for model fitting and aba_combine_strata for combining stratified models, clean_raster for applying spatial mask and value thresholds to a raster.
Examples
# load data
data(quatre_montagnes)
# build model
model_aba <- aba_build_model(quatre_montagnes$G_m2_ha, quatre_montagnes[, 9:76],
transform = "boxcox"
)
# build example raster to apply model
quatre_montagnes$X <- rep(1:8, 12)
quatre_montagnes$Y <- rep(1:12, each = 8)
metrics_map <- terra::rast(quatre_montagnes[, c(2, 3, 9:76)], type = "xyz")
predict_map <- aba_predict(model_aba, metrics_map)
# plot map
terra::plot(predict_map, main = "predictions")