https://github.com/arh926/nimblewomble

An R-package for Bayesian wombling with nimble

https://github.com/arh926/nimblewomble

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

An R-package for Bayesian wombling with nimble

Basic Info
  • Host: GitHub
  • Owner: arh926
  • License: other
  • Language: R
  • Default Branch: master
  • Size: 54.7 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

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. Gelfandhttps://doi.org/10.1198/016214506000000041 b. 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:

r 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

``` r 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)

mcsp = gpfit(coords = coords, y = y, kernel = "matern1")

zbeta = zbetasamples(y = y, coords = coords, model = mcsp$mcmc, kernel = "matern1") ```

Predicitve Inference for Rates of Change

``` r 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 = spggplot(dataframe = data.frame(grid, z = gradients$estimate.sx[,"50%"], sig = gradients$estimate.sx$sig)) p1 ``` Rplot

Wombling Measure: Predicitve inference on Line Integrals

``` r 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 + geompath(curve, mapping = aes(x, y), linewidth = 2) + geompath(curve, mapping = aes(x, y), colour = c(col.pts, NA), linewidth = 1, na.rm = TRUE)

``` Rplot01

Authors

| Name | Email | | |:------ |:--------------- | :--------- | | Aritra Halder (maintainer)| aritra.halder@drexel.edu | Asst. Professor, Dept. of Biostatistics, Drexel Univ.| | Sudipto Banerjee | sudipto@ucla.edu | Professor & Past Chair, Dept. of Biostatistics, UCLA | <!--- --->

Owner

  • Name: Aritra Halder
  • Login: arh926
  • Kind: user
  • Location: Philadelphia, PA
  • Company: Drexel University

Assistant Professor of Biostatistics

GitHub Events

Total
  • Public event: 1
  • Push event: 16
Last Year
  • Public event: 1
  • Push event: 16

Dependencies

DESCRIPTION cran
  • MBA * imports
  • cowplot * imports
  • ggplot2 * imports
  • metR * imports
  • nimble * imports
  • patchwork * imports
  • sf * imports