Commit b9adf081 authored by francois's avatar francois
Browse files

Update README.md

parent 0c6f6478
# spaMM-distrib
# Public repository for __spaMM__
Public repository for distribution of things related to __spaMM__:
[![CRAN](http://www.r-pkg.org/badges/version/spaMM)](https://cran.r-project.org/web/packages/spaMM)
[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/grand-total/spaMM?color=brightgreen)](http://www.r-pkg.org/pkg/spaMM)
[![Rdoc](http://www.rdocumentation.org/badges/version/spaMM)](http://www.rdocumentation.org/packages/spaMM)
__spaMM__ is a standard R package available on CRAN (latest version: 3.7.2, 2021/02/26). It was originally designed for fitting __spa__ tial generalized linear __M__ ixed __M__ odels, particularly the so-called geostatistical model allowing prediction in continuous space. But it is now a more general-purpose package for fitting mixed models, spatial or not, and with efficient methods for both geostatistical and autoregressive models. Its latest major addition is the ability to fit multivariate-response models. You can download here a [gentle introduction](http://kimura.univ-montp2.fr/%7Erousset/spaMM/spaMMintro.pdf) (latest version: 2021/02/26) to the package.
## What is spaMM ?
Use a CRAN repository to install the package in an R architecture, unless you are looking for something more specific here.
See the (unofficial) [CRAN github repository](https://github.com/cran/spaMM) for an archive of sources for all versions of spaMM previously published on CRAN.
__spaMM__ is an R package originally designed for fitting __spa__ tial generalized linear __M__ ixed __M__ odels, particularly the so-called geostatistical model allowing prediction in continuous space. But it is now a more general-purpose package for fitting mixed models, spatial or not, and with efficient methods for both geostatistical and autoregressive models. Its latest major addition is the ability to fit multivariate-response models.
<img align="right" width="300" height="300" src="https://gitlab.mbb.univ-montp2.fr/francois/spamm-distrib/-/blob/master/non-package/images/image_intro-IsoriX.gif">
## What to look for (or not) here ?
This repository provides whatever information I do not try to put into the R package, such as its vignette-like [gentle introduction](http://kimura.univ-montp2.fr/%7Erousset/spaMM/spaMMintro.pdf) (latest version: 2021/02/26).
It will also include a few selected versions of spaMM. However, use a CRAN repository for standard installation of the package, and see the (unofficial) [CRAN github repository](https://github.com/cran/spaMM) for an archive of sources for all versions of spaMM previously published on CRAN.
## General features
<!-- https://gitlab.mbb.univ-montp2.fr/francois/spamm-distrib/master/non-package/images/image_intro-IsoriX.gif -->
<img align="right" width="300" height="300" src="https://raw.githubusercontent.com/courtiol/IsoriX/master/image/image_intro-.gif">
Initial stimulus for spaMM development came from work by Lee and Nelder on h-likelihood (e.g. [Lee, Nelder & Pawitan](https://doi.org/10.1201/9781420011340), 2006; [Lee & Lee](http://dx.doi.org/10.1007/s11222-011-9265-9) 2012; see also [Molas and Lesaffre](http://dx.doi.org/10.1002/sim.3852), 2010), and it retains from that work several distinctive features, such as the ability to fit models with non-gaussian random effects (e.g., Beta- or Gamma-distributed), structured dispersion models (including residual dispersion models with random effects), and implementation of several variants of Laplace and PQL approximations. But it often relies on alternatives to the iterative algorithms considered by Lee and Nelder to jointly fit all model parameters, and on alternative implementations of the most expensive matrix computations. spaMM has distinct algorithms for three cases: sparse precision, sparse correlation, and dense correlation matrices, and is efficient to fit geostatistical, autoregressive, and other mixed models on large data sets. Notable features include:
- Fitting geostatistical models with random-effect terms following the `Matern` as well as the much less known `Cauchy` correlation models, or autoregressive models described by an `adjacency` matrix or `AR1` model, or an arbitrary given precision or correlation matrix (`corrMatrix`). Conditional spatial effects can be fitted, as in (say) `Matern(female|...)+Matern(male|...)` to fit distinct random effects for females and males.
- Fitting geostatistical models with random-effect terms following the `Matern` as well as the much less known `Cauchy` correlation models, or autoregressive models described by an `adjacency` matrix or `AR1` model, or an arbitrary given precision or correlation matrix (`corrMatrix`). Conditional spatial effects can be fitted, as in (say) `Matern(female|...)+Matern(male|...)` to fit distinct random effects for females and males (e.g., [Tonnabel et al., 2021](https://doi.org/10.1111/mec.15833)).
- A further class of spatial correlation models, "Interpolated Markov Random Fields" (`IMRF`) covers widely publicized approximations of Matérn models ([Lindgren et al. 2011](http://doi.org/10.1111/j.1467-9868.2011.00777.x)) and the multiresolution model of [Nychka et al. 2015](https://doi.org/10.1080/10618600.2014.914946).
- Allowed response families include zero-truncated variants of the Poisson and negative binomial, and the Conway-Maxwell-Poisson (`COMPoisson`) family;
- All the above features combined in multivariate-response models. Previously, more experimental facilities have been available for handling multinomial data only;
......@@ -18,6 +27,13 @@ Initial stimulus for spaMM development came from work by Lee and Nelder on h-lik
- A syntax close to that of `glm` or [`g`]`lmer`. It includes a growing list of extractor methods similar to those in `stats` or `nlme`/`lmer`, and functions for inference beyond the fits, such as `confint()` for confidence intervals of fixed-effect parameters, `predict()` and related functions for point prediction and prediction variances, and compatibility with functions from other packages such as `multcomp::glht()` (see `help("post-fit")`);
- Simple facilities for quickly drawing maps from model fits, using only base graphic functions. See [here](http://kimura.univ-montp2.fr/%7Erousset/spaMM/example_raster.html) for more elaborate examples of producing maps. The animated graphics on this page is from an application using the [`IsoriX` package](https://github.com/courtiol/IsoriX/blob/master/README.md).
The performance of Laplace approximations for spatial GLMMs was assessed in :
## References
The performance of Laplace approximations used by spaMM was assessed for spatial GLMMs in :
Rousset F., Ferdy J.-B. (2014) [Testing environmental and genetic effects in the presence of spatial autocorrelation](http://onlinelibrary.wiley.com/doi/10.1111/ecog.00566/abstract). Ecography, 37: 781-790.
Also available here is the [Supplementary Appendix G](http://kimura.univ-montp2.fr/%7Erousset/spaMM/RoussetF14AppendixG.pdf) from that paper, including comparisons with a trick commonly, but uncritically, used to constrain the functions `lmer` and `glmmPQL` to analyse spatial models.
For some substantial use of various features of spaMM, see e.g. the [IsoriX project](https://github.com/courtiol/IsoriX), or a story about [social dominance in hyaenas](https://doi.org/10.1038/s41559-018-0718-9), or [yet another depressing story about climate change](https://doi.org/10.1038/s41467-019-10924-4).
## Credits
Initial development was supported by a PEPS grant from the CNRS and University of Montpellier
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment