Skip to content

TeoGiane/SPMIX

Repository files navigation

SPMIX - Spatial Mixture Models in R

SPMIX collects sampling schemes that performs density estimation for spatially dependent areal data, in a Bayesian Nonparametric setting. Data on each area are modelled as a finite mixture of Gaussian kernels and the weights provides the spatial dependence among neighbours via the logistic multivariate CAR prior. The number of components of the mixture can be either fixed or variable: in the second case, a prior on such quantity is added and a reversible jump scheme is adopted to estimate the posterior distribution of the model.

Dependencies

SPMIX depends on:

  • Eigen: A C++ template library for linear algebra.
  • GNU Scientific Library: A numerical library for C and C++ programmers. It is required in src/polyagamma/ subfolder.
  • Stan Math Library: A BSD-3 licensed C++, reverse-mode automatic differentiation library designed to facilitate the construction and utilization of algorithms that utilize derivatives.
  • Google Protocol Buffers: A language-neutral, platform-neutral extensible mechanism for serializing structured data.

Prerequisites

SPMIX is an R package, so make sure to have R installed on your machine (see the project homepage otherwise) as well as the devtools package. Once R is installed, it can be insalled with the following command called from an R terminal.

> install.packages("devtools")

Note for Linux users: devtools and all R packages in Linux are built from source. Thus, you need to install some external libraries via package manager. Usually, the following command on Ubuntu/Debian leads to a succesfull installation of devtools.

# apt install libssl-dev libcurl4-openssl-dev libxml2-dev libgit2-dev libnode-dev

Installation

This package links gsl and protobuf as external libraries, while Eigen and stan/math are provided as R packages. All R dependencies are automatically installed via devtools.

External libraries are handled differently according to your operating system. Follow the instruction for Linux or Windows machines accordingly.


Linux Systems

  1. Install gsl via package manager.
# apt install libgsl-dev
  1. Install protobuf from source using CMake. The latter can be installed via package manager.
# apt install cmake
  1. Download and extract the latest Protocol Buffers Release from here. For a minimal installation, download the protobuf-cpp-<VERSION>.* asset.

  2. Once inside the folder containing protobuf source files, build and install it using the following command.

$ cmake . -Dprotobuf_BUILD_SHARED_LIBS=ON
$ cmake --build . [--parallel <NUM_THREADS>]
$ ctest --verbose
# cmake --install
# ldconfig
  1. Install SPMIX and all its package dependencies.
> devtools::install_github("TeoGiane/SPMIX")

Windows Systems

On Windows machines, external libraries will be available during installation automatically thanks to the rwinlib project. Thus, you only need to install SPMIX via:

> devtools::install("TeoGiane/SPMIX")

License

This package is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages