generating non-IID random sequences
- To: mathgroup at smc.vnet.net
- Subject: [mg79094] generating non-IID random sequences
- From: Yaroslav Bulatov <yaroslavvb at gmail.com>
- Date: Wed, 18 Jul 2007 03:01:01 -0400 (EDT)
I'm looking for a fast way to sample from a Markov-1 sequence of random bits. The method below is 3600 times slower than built-in RandomInteger function, can it be made much faster? p = 0.9; (* the probability of encountering 00 or 11 *) f = RandomChoice[{p^# (1 - p)^(1 - #), p^(1 - #) (1 - p)^#} -> {1, 0}] &; NestList[f, RandomChoice[{0, 1}], 100000]
- Follow-Ups:
- Re: generating non-IID random sequences
- From: Darren Glosemeyer <darreng@wolfram.com>
- Re: generating non-IID random sequences