mardi 12 septembre 2017

Generating correlated numbers in Matlab

I am creating x vectors of random numbers, each of them using

for i=1:x
 A(i,:) = randperm(n)
end

So one of the outcomes could be

 1 2 3 5 4 7 6 ... n

But obviously, each vector that I create is independent of the others. I would like to create random vectors that are correlated, i.e. that if 1 appears before 2 in the previous vector, it also has a high chance to be before 2 in the next vector.

Any ideas would be appreciated.




Aucun commentaire:

Enregistrer un commentaire