No BSD License
-
DGAnyMarginal(pmfs,Sigma,supp...
[samples,gammas,Lambda,joints2D,hists] = DGAnyMarginal(pmfs,Sigma,supports,Nsamples)
-
EstimateDiscreteJoint(A)
[B,ranges] = EstimateDiscreteJoint(A)
-
PoissonMarginals(means,acc)
% [pmfs,supports] = PoissonMarginals(means,acc)
-
SampleDGAnyMarginal(gammas,La...
[samples,hists]=SampleDGAnyMarginal(gammas,Lambda,supports,Nsamples)
-
[gammas,Lambda,joints2D]=Find...
% [gammas,Lambda,joints2D] = FindDGAnyMarginal(pmfs,Sigma,supports)
-
[samples,gammas,Lambda,joints...
[samples,gammas,Lambda,joints2D,cmfs,hists] = DGPoisson(means,Sigma,Nsamples,acc)
-
[y]=bivnor(a,b,rho)
-
binBinaryToDec(bin)
dec = binBinaryToDec(bin)
-
binHist(S)
-
binHistIndep(mu)
hc = binHistIndep(mu)
-
countElem(x,sv,ev)
-
findLatentGaussian(m,c,acc)
-
sampleCovPoisson(m,C,nSamples...
x = sampleCovPoisson(m,C,nSamples,err)
-
sampleDichGauss01(mu,Sigma,ns...
[s gamma rho] = sampleDichGauss01(mu,Sigma,nsamples,already_computed,acc)
-
vec(v)
-
demo.m
-
setPath.m
-
View all files
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
|
| EstimateDiscreteJoint(A)
|
function [B,ranges] = EstimateDiscreteJoint(A)
% [B,ranges] = EstimateDiscreteJoint(A)
% Estimates the discreet joint distribution of samples in a matrix A with
% dimension D x N, where N is the number of examples and D is the number
% of dimensions.
%
% Code from the paper: 'Generating spike-trains with specified
% correlations', Macke et al., submitted to Neural Computation
%
% www.kyb.mpg.de/bethgegroup/code/efficientsampling
A = A';
[N,d]=size(A);
if nargin==1
for k=1:d
[ranges{k},i{k},j(:,k)]=unique(A(:,k));
rangesize(k)=numel(ranges{k});
end
end
J=num2cell(j);
B=zeros(rangesize);
for k=1:N
ind=J(k,:);
B(ind{:})=B(ind{:})+1;
end
B=B/N;
|
|
Contact us at files@mathworks.com