MyNixOS website logo
Description

Bayesian Wombling using 'nimble'.

A software package to perform Wombling, or boundary analysis, using the 'nimble' Bayesian hierarchical modeling environment. Wombling is used widely to track regions of rapid change within the spatial reference domain. Specific functions in the package implement Gaussian process models for point-referenced spatial data followed by predictive inference on rates of change over curves using line integrals. We demonstrate model based Bayesian inference using posterior distributions featuring simple analytic forms while offering uncertainty quantification over curves. For more details on wombling please see, Banerjee and Gelfand (2006) <doi:10.1198/016214506000000041> and Halder, Banerjee and Dey (2024) <doi:10.1080/01621459.2023.2177166>.

nimblewomble: An R package for Bayesian wombling with nimble

The goal of nimblewomble is to perform Bayesian Wombling (boundary analysis) using nimble.

For more details on point-referenced Wombling please refer to: a. Bayesian Wombling: Sudipto Banerjee and Alan E. Gelfandb. Bayesian Modeling with Curvature Processes: Aritra Halder, Sudipto Banerjee and Dipak K. Dey <https://doi.org/10.1080/01621459.2023.2177166

Installation

You can install the development version of nimblewomble like so:

devtools::install_github("arh926/nimblewomble")

Example

Rplot02

This is a basic example which shows you the workflow on a simulated data:

Fitting a Gaussian Process

require(nimble)
require(nimblewomble)

set.seed(1)

N = 1e2
tau = 1
coords = matrix(runif(2 * N, -10, 10), ncol = 2); colnames(coords) = c("x", "y")
y = rnorm(N, 20 * sin(sqrt(coords[, 1]^2  + coords[, 2]^2)), tau)

mc_sp = gp_fit(coords = coords, y = y, kernel = "matern1")

zbeta = zbeta_samples(y = y, coords = coords,
                      model = mc_sp$mcmc,
                      kernel = "matern1")

Predicitve Inference for Rates of Change

xsplit = ysplit = seq(-10, 10, by = 1)[-c(1, 21)]
grid = as.matrix(expand.grid(xsplit, ysplit), ncol = 2)
colnames(grid) = c("x", "y")
gradients = sprates(grid = grid,
                    coords = coords,
                    model = zbeta,
                    kernel = "matern1")
                    require(ggplot2)
require(ggplot2)
require(cowplot)
require(MBA)
require(metR)

p1 = sp_ggplot(data_frame = data.frame(grid,
                                       z = gradients$estimate.sx[,"50%"],
                                       sig = gradients$estimate.sx$sig))
p1

Rplot

Wombling Measure: Predicitve inference on Line Integrals

curve = # Pick a curve from the surface that is interesting to you
wm = spwombling(coords = coords,
                curve = curve,
                model = zbeta,
                kernel = "matern1")

col.pts = sapply(wm$estimate.wm$sig, function(x){
  if(x == 1) return("green")
  else if(x == -1) return("cyan")
  else return(NA)
})

p2 = sp_ggplot(obs, legend.key.height = 0.7, legend.key.width = 0.4, text.size = 10)

p2 + geom_path(curve, mapping = aes(x, y), linewidth = 2) + 
  geom_path(curve, mapping = aes(x, y), colour = c(col.pts, NA), linewidth = 1, na.rm = TRUE)

Rplot01

Authors

NameEmail
Aritra Halder (maintainer)[email protected]Asst. Professor, Dept. of Biostatistics, Drexel Univ.
Sudipto Banerjee[email protected]Professor & Past Chair, Dept. of Biostatistics, UCLA.
Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows