Skip to content
How to encode a Pro...
 
Notifications
Clear all

[Solved] How to encode a Probability Transition Matrix?

2 Posts
2 Users
0 Reactions
2,727 Views
Posts: 4
Customer
Topic starter
(@qsw1wpg6oem829t8ebrrh7tlyok2)
Active Member
Joined: 4 years ago

How do you encode a probability transition matrix, which is a probability of going from State A to State B?

The issue here is that I can only use the State index once.  I need it twice.

1 Reply
Max Henrion
Posts: 2
Admin
(@maxhenrion)
Member
Joined: 12 years ago

An array may only use an Index once to identify a dimension. In Analytica, you identify indexes of a multidimensional array by the name of the index, rather than position (which is common in other languages). But there's a simple way to address your problem -- where you want to create a 2D matrix indexed by original State and Next State.  Given that you have an Index State, you define a second index,

      INDEX NextState := CopyIndex(State)

You can then define the matrix as, say of transition probabilities as:

      Variable TransitionProb := Table(State, NextState)(....)

See more details on the Analytica wiki at CopyIndex

Cheers

Max

Reply
Share:

Download Free Analytica


    We hate spam as much as you. We won't share your email with third parties.
    The free edition of Analytica includes these key Analytica features:
    Free Analytica has no time limit. The only constraint is it won’t let you create more than 100 variables or other objects. But your model can be quite substantial since each variable can be a multidimensional array. It also lets you explore, change inputs, and run existing models of any size (excluding features unique to the Enterprise or Optimizer editions).