Generating a transition probability matrix in excel

abberyfarm

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

I have a difficult problem.

Would anybody know if or how excel can be used to generate a transition probability matrix of data. It is to be used in a markov chain analysis later but I just wish to find out if excel can be used for now.

I'm thinking maybe it could be done with a pivot table or perhaps an add-in has been developed to do this already.

I have time, speed and acceleration data for a car in three columns. I'm trying to generate a 2 dimensional transition probability matrix of velocity and acceleration.

The concept is given a particular speed and acceleration I want to be able to look at the matrix and identify the most likely (probable) speed and acceleration that could occur next.

I have attached two pictures which illustrate the concept here. It is a secure file sharing site.

http://www.sendspace.com/file/3h7j49
http://www.sendspace.com/file/44myq4
http://www.sendspace.com/file/fo0fnz

I also attached a sample data file if anyone has an idea and wants to experiment :)

Appreciate any input

John
 
Hello shg,

Sorry for bothering you again. Would you have any thoughts on how to simulate more steps?

Thank you

John
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I can not understand what the calculations for the probabilities are. To have a transition probability matrix, should not each cell value (e.g. number of observed transitions from A-->B) be divided by the total number of transitions (19)?
How is it possible that with one transition from '2' to '0', the probability is 'zero'?

Many thanks

 
Upvote 0
To calculate a transition, you generate a random number [0...1) and do a lookup agains the transition probability table.
 
Upvote 0
The frequency table is correct but the transition table is wrong - the rows must sum to one. You need to divided each entry in the frequency table by the row sum.
 
Upvote 0
what is the use of the random number X2? i'm also doing a markov chain analysis.. and also, why are the sum of the probabilities (in a row) in the transition matrix not equal to one? is the error in the formula for Q:V.. thank you so much..
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

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