Generating random correlated numbers

조회 수: 1 (최근 30일)
Josué Ortega
Josué Ortega 2017년 9월 12일
편집: Mark Matusevich 2017년 9월 13일
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.
Each number needs to appear once and only once on each vector. Any ideas would be appreciated.
  댓글 수: 1
Mark Matusevich
Mark Matusevich 2017년 9월 13일
편집: Mark Matusevich 2017년 9월 13일
It is unclear what distribution you are looking for. E.g. choosing in each iteration randomly two different numbers and switching them, while keeping the remaining in place would fit your description, but I'm guess this is not kind of thing you are looking for. I think you should clarify what do you mean by "correlated".

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by