Skip to contents

MBG Model Runner

Model runner class

MbgModelRunner
MBG model runner class

MBG core inputs

Functions to build the ID raster and load model covariates

build_id_raster()
Build ID raster
load_covariates()
Load covariates
make_world_template_raster()
Make world template raster

MBG model fitting and prediction

Individual functions for model fitting and prediction. These can also be executed through the MbgModelRunner class.

fit_inla_model()
Fit INLA model
prepare_inla_data_stack()
Prepare data stack for INLA
run_regression_submodels()
Run regression sub-models
generate_cell_draws_and_summarize()
Generate cell draws and summary rasters from INLA model
summarize_draws()
Summarize draws
values_to_raster()
Insert values into a raster

Model validation

Functions for generating predictive validity metrics. These can also be executed through the MbgModelRunner class.

log_posterior_density()
Generate log posterior predictive density from a geostatistical surface onto point data
rmse_raster_to_point()
Generate RMSE from an estimated raster surface and point data

Pixel-to-polygon aggregation

Functions to aggregate rasters and pixel-level predictive draw matrices to polygon boundaries. These can also be executed through the MbgModelRunner class.

aggregate_draws_to_polygons()
Aggregate grid cell draws to polygons
aggregate_raster_to_polygons()
Aggregate a raster to polygons
build_aggregation_table()
Build aggregation table
calculate_pixel_fractions_single_polygon()
Calculate fractional pixels in a polygon

Other

Miscellaneous helper functions

dissolve_sf_by_attribute()
Dissolve sf object by attribute
.onAttach()
Behavior when attaching the mbg package
logging_get_timer_log()
Get timer log
logging_start_timer()
Start logging timer
logging_stop_timer()
End logging timer
make_time_stamp()
Make time stamp
vif_covariate_select()
Run variance inflation factor (VIF) selection on input covariates