Skip to content
/ mbg Public

❗ This is a read-only mirror of the CRAN R package repository. mbg — Model-Based Geostatistics. Homepage: https://henryspatialanalysis.github.io/mbg/ Report bugs for this package: https://github.com/henryspatialanalysis/mbg/issues

License

Notifications You must be signed in to change notification settings

cran/mbg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nathaniel Henrycran-robot
Nathaniel Henry
and
Apr 26, 2025
89a15b3 · Apr 26, 2025

History

2 Commits
Apr 26, 2025
Apr 2, 2025
Apr 2, 2025
Apr 26, 2025
Apr 2, 2025
Apr 26, 2025
Apr 2, 2025
Apr 26, 2025
Apr 2, 2025
Apr 26, 2025

Repository files navigation

Model-Based Geostatistics

CRAN Documentation build

mbg is an R package for model-based geostatistics.

The mbg package provides a simple interface to run spatial machine learning models and geostatistical models that estimate a continuous (raster) surface from point-referenced observations and, optionally, a set of raster covariates. The package also includes functions to summarize raster estimates by (polygon) region while preserving uncertainty.

Overview of the MBG workflow\n

The mbg package combines features from the sf, terra, and data.table packages for spatial data processing; caret for spatial ML models; and R-INLA for geostatistical models.


Using the package

You can install the latest stable version of the mbg package from CRAN:

install.packages("mbg")

Some core package functions rely on R-INLA, which is not available on CRAN. If you do not already have the INLA package installed, you can download it following these instructions.

After installing and package and loading it using library(mbg), you can access the package vignette by running help(mbg), or get documentation for a specific function by running e.g. help(MbgModelRunner).


Package workflow

A typical MBG workflow includes the following steps:

  1. Load point data on outcomes, raster covariate surfaces, and a raster population surface
  2. (Optional): Run machine learning models relating the input covariate surfaces to the outcome, producing predictive raster surfaces from a variety of methods
  3. Prepare inputs for the geostatistical model. This includes the outcomes point data, model specifications, a spatial 2-D mesh, and either the input covariate surfaces or the ML predictive surfaces
  4. Run the geostatistical model. This model predicts the outcome as a linear combination of the raster surfaces and a SPDE approximation to a Gaussian process over space.
  5. Using the model fit, generate gridded predictions of the outcome across the entire study area. Uncertainty is captured by generating 250 posterior predictive draws at each pixel location.
  6. Summarize predictive draws as raster surfaces by taking the mean, median, and 95% uncertainty interval bounds of draws at each pixel location
  7. (Optional): Aggregate from pixels to administrative boundaries, preserving uncertainty

For more details, see the introductory vignette.

About

❗ This is a read-only mirror of the CRAN R package repository. mbg — Model-Based Geostatistics. Homepage: https://henryspatialanalysis.github.io/mbg/ Report bugs for this package: https://github.com/henryspatialanalysis/mbg/issues

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages