algorithm - Generating a vector of correlated binary variables in O(n) -


i'm looking efficient o(n) algorithm creating vectors of correlated binary values, given:

  • all values must identically distributed (though not independent)
  • they must have fixed mean p
  • they must have fixed correlation r each other

e.g. given p=0.5 , r=1.0 expect vectors [0 0 0 ...] , [1 1 1 ...] generated equal probability. p=0.5 , r=0.0 expect binary values independent fair coin tosses.

because algorithm must run in o(n) time, solution involves generating correlation matrix automatically ruled out.

is there simple algorithm can achieve this?


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

c - getting error: cannot take the address of an rvalue of type 'int' -

How to merge four videos on one screen with ffmpeg -