Simple markov chain simulation

abberyfarm

Well-known Member
Joined
Aug 14, 2011
Messages
733
Hi there,

Would anybody know how to simulate the states of a markov chain in excel given the transition probability matrix and a random number.

Here is an example:

I have random numbers in column A and a transition probability matrix in yellow.

Say the initial state is State A how could simulate what the next 9 states will be?

Thanks

Excel Workbook
ABCDEFG
2Random number**Transition Matrix*
30.72**State AState BState C*
40.75*State A0.20.50.3*
50.02*State B0.10.70.2*
60.09*State C0.50.40.1*
70.63******
80.80******
90.35******
10***StepsSimulate states**
11***1State A (initial state)**
12***2?**
13***3?**
14***4?**
15***5?**
16***6?**
17***7?**
18***8?**
19***9?**
20***10?**
Sheet1




This thread is available here also

http://www.ozgrid.com/forum/showthread.php?t=170671&p=632216#post632216
 
Last edited:

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
My apologies, I don't know why there are *s in the above post. Here is a cleaner version

[TABLE="width: 498"]
<colgroup><col><col span="6"></colgroup>[TR]
[TD]
Excel Workbook
ABCDEFG
2Random numberTransition Matrix
30.72State AState BState C
40.75State A0.20.50.3
50.02State B0.10.70.2
60.09State C0.50.40.1
70.63
80.80
90.35
10StepsSimulate states
111State A (initial state)
122?
133?
144?
155?
166?
177?
188?
199?
2010?
Sheet1



[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 3"][/TD]
[TD][/TD]
[/TR]
[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top