Sampling from multivariate correlated binary and poisson random variables

These Matlab functions can be used to generate multivariate correlated binary variables, and correl
Updated 9 Jul 2008

No License

You can use the software in this package to efficiently sample from
(1) correlated multivariate binary random variables (multivariate Bernoulli)
(2) correlated multivariate Poisson random variables
(3) correlated random variables with arbitrary marginal statistics.
Applications include modeling and generating of artificial neural data.

The implementation includes sampling and parameter fitting for the Dichotomized Gaussian distribution. For some parameters this provides and efficient alternative to the maximum-entropy distribution, the Ising model.

Detailed information about the contents are contained in the readme-file at For an instruction on how to use the code, run the demo.m script.

The methods implemented here are described in two publications:

J. H. Macke, P. Berens, et al., Generating spike-trains with specified correlation-coefficients, Neural Computation, 2008 (accepted) (

Matthias Bethge and Philipp Berens, Near-Maximum Entropy Models for Binary Neural Representations of Natural Images, Advances in Neural Information Processing 2008 (

Cite As

Philipp Berens (2024). Sampling from multivariate correlated binary and poisson random variables (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

There were two svn subdirectories included in the zip-file by accident. These were removed.