Home
Name Modified Size InfoDownloads / Week
GeoJAGS 2018-03-28
Examples 2018-03-28
List of functions in GeoJAGS-0.3.pdf 2018-04-05 225.5 kB
README.md 2018-02-26 4.3 kB
readme.md 2018-02-15 4.1 kB
List of functions in GeoJAGS.pdf 2018-02-13 172.7 kB
INSTALL 2018-02-09 4.2 kB
Totals: 7 Items   410.7 kB 0

output: html_document

Synopsis

GeoJAGS is a module for the JAGS software that features several functions that simplify spatial data analysis in the Bayesian context. Currently it includes eleven covariance functions for point-referenced data analysis and a function that computes the precision matrix for the conditionally autoregressive CAR model for areal data analysis.

Code Example

Within the JAGS script, the covariance functions available in the GeoJAGS model can be used as follows:

Sigma <- CVPowerExp(coords, sig2, phi , tau2, 2)
Y ~ dmnorm(mu, Omega) 
Omega <- inverse(Sigma)

Here, Sigma is the covariance matrix, coords is the vector of coordinates of the data, sig2 is the non-spatial variance, phi is the range, tau2 is the spatial variance, and the last parameter is the power of the powered exponential function CVPowerExp (by setting its value to 2 defines the Gaussian covariance function). In addition, mu is the vector mean, and Omega is the precision matrix (inverse of the covariance matrix).

Description of all covariance functions available in the module can be found in the GeoJAGS Manual.

The CAR model can be used in a simple manner:

w ~ dmnorm(mu , precMatrixCAR(W, rho, tau2))

In this case, w is the vector of random effects, precMatrixCAR computes the precision matrix for the proper CAR model given the proximity matrix W, the parameter rho (introduced to make the matrix non-singular), and the spatial precision tau2.

Motivation

Hierarchical Bayesian modeling is often applied to spatial data. However, JAGS currently lacks a module for performing spatial data analyses. This work intends to fill this gap, based on Wabersich and Vandekerckhove (2014). It can be seen as a short tutorial on how to implement a new JAGS module with univariate functions and distributions.

Installation

To install this module in a Unix machine, download the source code, open the Terminal in the target folder and follow these steps:

  • autoreconf -fvi: This command will generate a number of auxiliary files that are necessary for the configuring and building process.

  • ./configure: This command configures the source package for building on your system.

  • make: This command compiles the source code into system-specific object code.

  • make install: This command command will copy the module library to an appropriate location in the system where JAGS can find and load it.

This module will soon be available for Windows users.

API Reference

Depending on the size of the project, if it is small and simple enough the reference docs can be added to the README. For medium size to larger projects it is important to at least provide a link to where the API reference docs live.

Tests

The covariance functions were tested using the elevations data set, available in geoR R package (see Ribeiro Jr and Diggle, 2016). We have chosen this database since it is well known in the literature and thus allows a full comparison with published results to evaluate the performance of the GeoJAGS module in terms of parameter estimation.

The precision matrix for the CAR model was tested through a simulation study.

Contributors

Magno Tairone de Freitas Severino, Masters student at Universidade Federal de Minas Gerais (magnotairone@ufmg.br).

Vinícius Diniz Mayrink, Professor at Universidade Federal de Minas Gerais (vdm@est.ufmg.br).

Fábio Nogueira Demarqui, Professor at Universidade Federal Fluminense (fndemarqui@id.uff.br).

License

Copyright (C) 2007 Free Software Foundation, Inc.

License: GPL v3|

Source: README.md, updated 2018-02-26