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

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

authentication - ASP.NET Core 1.0. Bearer Token, cannot access custom claims -