Algebraic statistics in R

algstat provides functionality for algebraic statistics in R. Current applications include exact inference in log-linear models for contingency table data, analysis of ranked and partially ranked data, and general purpose tools for multivariate polynomials, building on the mpoly package. To aid in the process, algstat has ports to Macaulay2, Bertini, LattE-integrale and 4ti2.


Version 0.0.2


  • Internals of several functions have been tidied.
  • Functions calling the system now use system2 to increase portability. (Thanks to Profs. Brian Ripley and Uwe Ligges for the suggestions.)
  • Description now has SystemRequirements statement along with INSTALL file providing a step-by-step guide for installation of LattE integrale.
  • The Description file has been updated to better to conform to CRANs standards (v. 3184, accessed 12/3/14).
  • LattE's count function has broader support now, see ?count and examples.

Version 0.0.1


  • Pathing has been updated substantially on OS-X and Windows platforms.
  • LattE's count function now works through a function called count; it is used to count lattice points.
  • A new function countTables, based on count, counts the number of tables with the same marginals as a given table.
  • LattE's latte-maximum and latte-minimum now work, allowing for the solution of linear programs (with integer coefficients) via LattE's routines. Be careful with these as they are experimental in LattE (see examples).


  • 4ti2 now has it's own path in options() called "markovPath" (4ti2Path was too unwieldy). This makes it easier to point to 4ti2 functions vs LattE functions. It is searched for differently on different operating systems but can be set manually.


  • The markov function now defaults dim to NULL to conform to conform to good coding practice (it is an early argument).

Version 0.0.0


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.0.2 by David Kahle, 4 years ago

Browse source code at

Authors: David Kahle [aut, cre] , Luis Garcia-Puente [aut]

Documentation:   PDF Manual  

GPL-2 license

Imports stringr, reshape2, Rcpp

Depends on mpoly

Linking to Rcpp

System requirements: Optionally Latte-integrale, Bertini, and Macaulay2. Cygwin is required for each of the above for Windows users. See INSTALL file for details.

See at CRAN