Sudipto's Software Page
Return to Sudipto Banerjee's home page
- spBayes IS HERE!!!.
spBayes is an R package that promises to perform Bayesian hierarchical modelling for spatial data sets. It is hosted on the R-package repository (or your favourite mirror) as a contributed extension package. Installing spBayes is similar to installing any other R-package and instructions for Windows and Linux can be found here.
- MBA (Multilevel B-spline approximation) IS HERE!!!.
MBA is an R package that contains routines that provide surface approximation from a bivariate scatter of data points using multilevel B-splines. This is useful for creating surface interpolation plotsfrom scattered data used in spatial statistics and operates much faster than the older Akima library. The main underlying algorithm is taken from the published work of Lee, Wolberg and Shin (1997). It can be downloaded from the R-package repository
The remainder of this page lists some C++, Java and R Programs that may be useful for statistical computing. Please note that these are not well-documented, but the user familiar with these languages should find little difficulty in deciphering these programs. These libraries have been used for several of my research projects; although less efficient than commercial libraries, they are very transparent and easy to use.
C++ programs
StatPack.zip is a zip file containing the following files:
- lapack.cpp -- a C++ file containing several matrix algebra functions, including basic matrix and vector operations (addition, subtraction, multiplication, kronecker products), matrix inversion, solving linear systems, determinants, log-determinants, matrix decompositions (Cholesky, LU, QR and SVD), eigen-values and eigen-vectors etc. Only C++ classes have been used (not templates) to make this more accessible (for example C programmers can easily port these functions). The header file containing the class definitions is lapack.h.
- generators.cpp -- a C++ file containing some useful random number generation routines from different distributions: uniform, normal, exponential, gamma, beta, multinomial, multivariate normal, Wishart and inverted-Wishart. The header file is generators.h
- A makefile format for creating a static library, StatPack.a is also included.
Spatial.zip is a zip file containing the following files:
- areal.cpp -- C++ functions for statistical modelling of areal data . Includes the CAR prior and some functions for creating the neighborhoods.
- geodesy.cpp -- C++ functions for calculating geodetic distances based upon latitude-longitude and also for euclidean distances. These are useful for geostatistical modelling.
Java Programs
- StatPack.jar is a Java Archive file containing the JAMA (JAvaMAtrix) package from NIST (I have added a kronecker method for kronecker products and a symmetrize method that helps in stabilizing symmetric matrices for Cholesky decompositions). Also included is a Distribution package with classes for random number generation, and some useful functions for spatial modelling.
- Just add StatPack.jar to your CLASSPATH and you should be able to access the methods.
- LinearModel.zip contains some simple linear model examples that are fitted using MCMC. They include Gibbs samplers, component-wise Metropolis (in subdirectory Metropolis) and joint Metropolis (in two different Java styles, uner Metropolis2 and Metropolis3). These do not really need MCMC, but can prove useful for someone starting to hard-code MCMC. Uses the statpack.jarfile.
Other R Programs
- Installing geo-R: The file InstallingGeoR is a
simple text file containing instructions to install geoR on R for Windows and Linux.
- Getting started with geo-R: The file Book.R is a simple introduction to some geoR functions that illustrate some spatial analysis tools using the scallops data, found in scallops.txt.
- A Bayesian kriging example: The file Bayes1.R is a first example of Bayesian kriging in geoR on the data TemperaturePrecipitationElevation.txt.
- distonearth.R is a R source file containing functions for computing distances on the earth's surface using different methods. Some of these have been used in my Biometrics paper On Geodetic Distance Computations in Spatial Modelling. as given in the file GeodesicsExample.R.
- Slopes.zip is a zip file containing the R program to compute spatial gradients using the methods described in Banerjee, S., Gelfand, A.E. and Sirmans, C.F (2003). "Directional Rates of Change Under Spatial Process Models". Journal of the American Statistical Association, 98:946-954.
- OrderFreeGMCARwin32.zip and OrderFreeGMCARlinux.zip are zip files containing the programs and the Minnesota cancer data used in the manuscript Jin, X., Banerjee, S. and Carlin, B.P. (2006) Order-free Coregionalized Areal Data Models with Application to Multiple Disease Mapping. The programs are written in C to harness maximum efficiency in terms of speed and use the Rlapack and Rblas libraries for matrix computations. They can be run from within R by sourcing the "mcar.R" function present in the directory. The Linux version includes a Makefile that compiles and creates the mcar_main.so dynamic library which is dynamically loaded by mcar.R.
WinBUGS Programs
- CBCScodes.txt is a text file containing the WinBUGS programs to compute cure rate models using the methods described in Cooner, F., Banerjee, S., Carlin, B.P. and Sinha, D. (2006). "Flexible Cure Rate Modelling Under Latent Activation Schemes". Journal of the American Statistical Association, (to appear).