No BSD License  

Highlights from
Sampling from multivariate correlated binary and poisson random variables

from Sampling from multivariate correlated binary and poisson random variables by Philipp Berens
These Matlab functions can be used to generate multivariate correlated binary variables, and correl

binBinaryToDec(bin)
function dec = binBinaryToDec(bin)

% dec = binBinaryToDec(bin)
%   converts binary vectors to corresponding decimal numbers
%   last position is 2^0, first is 2^n-1
%
% Code from the paper: 'Generating spike-trains with specified
% correlations', Macke et al., submitted to Neural Computation
%
% www.kyb.mpg.de/bethgegroup/code/efficientsampling


bb = (size(bin,1)-1):-1:0;
dec = (2.^bb) * (bin>0);

    

Contact us