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 - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -