multinomineq
Implements Gibbs sampling and Bayes factors for multinomial models with linear
inequality constraints on the vector of probability parameters. As special
cases, the model class includes models that predict a linear order of binomial
probabilities (e.g., p[1] < p[2] < p[3] < .50) and mixture models assuming that
the parameter vector p must be inside the convex hull of a finite number of
predicted patterns (i.e., vertices).
Inequality-constrained multinomial models have applications in multiple areas in psychology and beyond:
A formal definition of inequality-constrained multinomial models and the implemented computational methods for Bayesian inference is provided in:
Please cite this paper if you use multinomineq in publications.
The package vignette provides a short introduction of how to apply the main functions of multinomineq:
vignette('multinomineq_intro')
The vignette is also available https://www.dwheck.de/vignettes/multinomineq_intro.html.
The package multinomineq can directly be installed from CRAN via:
install.packages("multinomineq")
Alternatively, if developer tools for R are installed (see instructions below),
the most recent version of multinomineq can also be installed from GitHub via:
### install dependencies:
install.packages("devtools","RcppArmadillo","RcppProgress",
"Rglpk", "quadprog", "RcppXPtrUtils")
### install from Github:
devtools::install_github("danheck/multinomineq")
To transform between the vertex (V) and the inequality (A*x<b) representation of
a polytope, it is necessary to install the package rPorta. The package is available on
GitHub (https://github.com/TasCL/rPorta). The package cannot be compiled with R>=4.0.0.
For older R versions, the precompiled package can be installed via:
install.packages("rPorta", repos = "https://danheck.github.io/drat/")
On Linux, GLPK libraries have to be installed via the console:
sudo apt-get install libglpk-dev
To compile C++ code, Windows and Mac require
Rtools and
Xcode Command Line Tools, respectively.
Moreover, on Mac, it might be necessary to install the library gfortran manually, as required to compile the package RcppArmadillo.