Skip to content

xzheng42/dnnmp-examples-env-2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DNNMP: Discrete nearest-neighbor mixture process

This repository contains the R package dnnmp (currently developer's version) and R scripts to reproduce the numerical results in

Xiaotian Zheng. Athanasios Kottas. Bruno Sansó. Zheng, X., Kottas, A., & Sansó, B. (2023). Bayesian geostatistical modeling for discrete-valued processes. Environmetrics, 34(7), e2805. https://doi.org/10.1002/env.2805

Installing and using the dnnmp package

You can install the package with devtools

devtools::install_github("xzheng42/dnnmp-examples-env-2023", subdir = "dnnmp")
library(dnnmp)

Main functions of the package are dnnmp and predict.dnnmp:

  • dnnmp fits a DNNMP model via Markov chain Monte Carlo (MCMC).
  • predict.dnnmp (or simply predict) generates posterior predictive samples for a set of new locations given a dnnmp object.

Notes: The current version was tested on macOS 10.15.7 under R version 4.2.2 and on Fedora Linux 38 under R version 4.3.2.

Workflow to reproduce numerical results

R scripts to reproduce results in the paper are available in data-examples/, and data/ contains the survey routes (names, numbers, location information, status, etc.) available in the North American Breeding Bird Survey (BBS) Dataset and the northern cardinal (Cardinalis cardinalis) count data.

  • Run all simulation experiments: run_all_sim_rscripts.R.

  • Run all BBS data examples: run_all_bbs_rscripts.R.

  • Simulation experiments in Section 5.1 and Section D.1: sim1_mcmc.R and sim1_results (first simulation experiment); sim2_mcmc.R, sim2_model_comp, sim2_results (second simulation experiment);

  • Data analyses in Section 5.3: bbs_data_analysis.R.

  • Data analyses in Section D.2: bbs_gaus_sa_1_mcmc.R, bbs_gaus_sa_2_mcmc.R, bbs_gaus_sa_1_results.R, and bbs_gaus_sa_2_results.R (Section D.2.1); bbs_comp_1_mcmc.R and bbs_comp_1_results.R (Section D.2.2); bbs_comp_2_mcmc.R and bbs_comp_2_results.R (Section D.2.3);

  • Randomized quantile residual analysis for model checking: sim_model_checking.R and bbs_model_checking.R.

About

Data and code for data examples in "Bayesian geostatistical modeling for discrete-valued processes.” Environmetrics, 2023.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published