Re: simulating a 2-state Markov process
- To: mathgroup at smc.vnet.net
- Subject: [mg41417] Re: [mg41369] simulating a 2-state Markov process
- From: Bobby Treat <drmajorbob at mailblocks.com>
- Date: Sun, 18 May 2003 05:04:28 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Oh yeah, I didn't show you how to simulate draws.
For example:
sim[H] := If[Random[] < p, T, H]
sim[T] := If[Random[] < q, H, T]
p = .45; q = 0.35;
NestList[sim, H, 30]
Bobby
-----Original Message-----
From: David E. Burmaster <deb at alceon.com>
To: mathgroup at smc.vnet.net
Subject: [mg41417] [mg41369] simulating a 2-state Markov process
Dear MathGroup,
Can someone please suggest an efficient way to use Mathematica to
draw realizations from a 2-state Markov process as outlined below?
i want to specify the transition probabilities and the number of
transitions to simulate.
=-=
for notation....
1. let's denote the two states as H and T (for Heads and Tails, even
though i am thinking about a process more general than flipping a
coin)
2. let's denote the four conditional transition probabilities as follows
prob(T | H) = p
prob(H | H) = 1-p
and
prob(H | T) = q
prob(T | T) = 1-q
3. for initial conditions, let the process begin in state H
=-=
within this framework, p and q can take any values in the unit square
(0, 1] x (0, 1]
=-=-=
thank you for your help
dave
--
************************************
David E. Burmaster, Ph.D.
Alceon Corporation
POBox 382069
Cambridge, MA 02238-2069
617-864-4300
deb at alceon.com
www.alceon.com
************************************