The package implements an MCMC algorithm for sampling of
binary matrices with fixed margins complying to the Rasch model.
Its stationary distribution is uniform. The algorithm also allows
for square matrices with fixed diagonal.
Parameter estimates in the Rasch model only depend on the marginal totals of
the data matrix that is used for the estimation. From this it follows that, if the
model is valid, all binary matrices with the same marginals as the observed one
are equally likely. For any statistic of the data matrix, one can approximate
the null distribution, i.e., the distribution if the Rasch model is valid, by taking
a random sample from the collection of equally likely data matrices and constructing
the observed distribution of the statistic.
One can then simply determine the exceedence probability of the statistic in the
observed sample, and thus construct a non-parametric test of the Rasch model.
The main purpose of this package is the implementation of a methodology to build nonparametric
tests for the Rasch model.
In the context of social network theories, where the structure of binary asymmetric
relations is studied, for example,
person a esteems person b, which correponds to a 1 in cell (a, b)
of the associated adjacency matrix. If one wants to study
the distribution of a statistic defined on the adjacency matrix and conditional
on the marginal totals, one has to exclude the diagonal cells from consideration, i.e.,
by keeping the diagonal cells fixed at an arbitrary value. The
has implemented an appropriate option, thus it can be also used for sampling random adjacency
matrices with given marginal totals.
|License:||GNU GPL 2, June 1991|
The user has to supply a binary input matrix. After defining appropriate control
rsctrl the sampling function
may be called to obtain an object of class
RSmpl which contains the
generated random matrices in encoded form. After defining an appropriate function
to operate on a binary matrix (e.g., calculate a statistic such as
the application of this function to the sampled matrices is performed
rstats. Prior to applying the user defined function,
decodes the matrices packed in the
The package also defines a utility function
rsextrobj for extracting certains parts from
RSmpl-object resulting in an object of class
Both types of objects can be saved and reloaded for later use.
Summary methods are available to print information on these objects, as well as
on the control object
RSctr which is obtained from using
rsctrl containing the specification for the sampling routine.
The current implementation allows for data matrices up to 4096 rows and 128 columns.
This can be changed by setting
to values which are a power of 2. These values should also be changed in
For convenience, we reuse the Fortran code of package version 0.8-1 which cicumvents the
compiler bug in Linux distributions of GCC 4.3. In case of compilation errors (due to a bug in Linux distributions of GCC 4.3) please use
RaschSampler.f90 from package version 0.8-1 and change
accordingly (or use GCC 4.4).
Reinhold Hatzinger, Patrick Mair, Norman D. Verhelst
Maintainer: <[email protected]>
Verhelst, N. D. (2008) An Efficient MCMC Algorithm to Sample Binary Matrices with Fixed Marginals. Psychometrika, Volume 73, Number 4
Verhelst, N. D., Hatzinger, R., and Mair, P. (2007) The Rasch Sampler. Journal of Statistical Software, Vol. 20, Issue 4, Feb 2007
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.