, 73:705 | Cite as

An Efficient MCMC Algorithm to Sample Binary Matrices with Fixed Marginals

  • Norman D. Verhelst
Theory and Methods


Uniform sampling of binary matrices with fixed margins is known as a difficult problem. Two classes of algorithms to sample from a distribution not too different from the uniform are studied in the literature: importance sampling and Markov chain Monte Carlo (MCMC). Existing MCMC algorithms converge slowly, require a long burn-in period and yield highly dependent samples. Chen et al. developed an importance sampling algorithm that is highly efficient for relatively small tables. For larger but still moderate sized tables (300×30) Chen et al.’s algorithm is less efficient. This article develops a new MCMC algorithm that converges much faster than the existing ones and that is more efficient than Chen’s algorithm for large problems. Its stationary distribution is uniform. The algorithm is extended to the case of square matrices with fixed diagonal for applications in social network theory.


MCMC Rasch model nonparametric tests importance sampling social networks 


  1. Besag, J., & Clifford, P. (1989). Generalized Monte Carlo significance tests. Biometrika, 76, 633–42. CrossRefGoogle Scholar
  2. Chen, Y. (2006). Simple existence conditions for zero-one matrices with at most one structural zero in each row and column. Discrete Mathematics, 306, 2870–877. CrossRefGoogle Scholar
  3. Chen, Y., Diaconis, P., Holmes, S., & Liu, J. (2005). Sequential Monte Carlo methods for statistical analysis of tables. Journal of the American Statistical Association, 100, 109–120. CrossRefGoogle Scholar
  4. Chen, Y., & Small, D. (2005). Exact tests for the Rasch model via sequential importance sampling. Psychometrika, 70, 11–30. CrossRefGoogle Scholar
  5. Connor, E., & Simberloff, D. (1979). The assembly of species communities: chance or competition. Ecology, 60, 1132–1140. CrossRefGoogle Scholar
  6. Gale, D. (1957). A theorem on flows in networks. Pacific Journal of Mathematics, 7, 1073–1082. Google Scholar
  7. Guttorp, P. (1995). Stochastic modeling of scientific data. London: Chapman and Hall. Google Scholar
  8. Hastings, W.K. (1970). Monte Carlo sampling methods using Markov chains and their applications. Biometrika, 57, 97–109. CrossRefGoogle Scholar
  9. Kong, A., Liu, J., & Wong, W. (1994). Sequential imputations and Bayesian missing data problems. Journal of the American Statistical Association, 89, 278–288. CrossRefGoogle Scholar
  10. Marshall, A., & Olkin, I. (1979). Inequalities: theory of majorization and its applications. San Diego: Academic Press. Google Scholar
  11. Metropolis, N., Rosenbluth, A.W., Rosenbluth, M.N., Teller, A.H., & Teller, E. (1953). Equations of state calculations by fast computing machines. Journal of Chemical Physics, 21, 1087–1091. CrossRefGoogle Scholar
  12. Musalem, A., Bradlow, E., & Raju, J. (2008, in press). Bayesian estimation of random-coefficients models using aggregate data. Journal of Applied Econometrics. Google Scholar
  13. Ponocny, I. (2001). Nonparametric goodness-of-fit tests for the Rasch model. Psychometrika, 66, 437–460. CrossRefGoogle Scholar
  14. Prabhu, N. (1965). Stochastic processes. Basic theory and its applications. New York: Macmillan. Google Scholar
  15. Rao, A., Jana, R., & Bandyopadhyay, S. (1996). A Markov chain Monte Carlo method for generating random (0,1)-matrices with given marginals. Sankhya, Series A, 58, 225–242. Google Scholar
  16. Roberts, A., & Stone, L. (1990). Island sharing by archipelago species. Oecologia, 83, 560–567. CrossRefGoogle Scholar
  17. Ryser, H. (1957). Combinatorial properties of matrices with zeros and ones. The Canadian Journal of Mathematics, 9, 371–377. Google Scholar
  18. Ryser, H. (1963). Combinatorial mathematics. In Carus mathematical monographs. Washington: The Mathematical Association of America. Google Scholar
  19. Snijders, T. (1991). Enumeration and simulation for 0-1 matrices with given marginals. Psychometrika, 56, 397–417. CrossRefGoogle Scholar
  20. Tanner, M.A. (1996). Tools for statistical inference (Third edn.). New York: Springer. Google Scholar
  21. Wasserman, S. (1977). Random directed graph distributions and the triad census in social networks. Journal of Mathematical Sociology, 5, 61–86. Google Scholar

Copyright information

© The Psychometric Society 2008

Authors and Affiliations

  1. 1.CITO, National Institute for Educational MeasurementArnhemThe Netherlands

Personalised recommendations