Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help!!Help!!Help!!

6 views
Skip to first unread message

janet...@yahoo.com

unread,
May 17, 2008, 8:35:53 AM5/17/08
to
Hellooooooooooooooooooooooooooo!!!!!!!!!!!!!
mambooooooooooooooooooooooo!!!!
Jane here ,from East Africa.

Could any expert on Markov Transtition Matrix pls pls pls help me an
example on how to enterprete the results after one has ran the model
on GAMS.

My appreciations.

God bless!!

Ray Vickson

unread,
May 18, 2008, 1:32:42 PM5/18/08
to
On May 17, 5:35 am, janethng...@yahoo.com wrote:
> Hellooooooooooooooooooooooooooo!!!!!!!!!!!!!
> mambooooooooooooooooooooooo!!!!
> Jane here ,from East Africa.
>
> Could any expert on Markov Transtition Matrix pls pls pls help me an
> example

What does this mean? Do you have an example that you want to interpret
(not 'enterprete'), or do you want us to supply you with an example?

> on how to enterprete the results after one has ran the model
> on GAMS.
>
> My appreciations.
>
> God bless!!

Assuming that you already have an example (rather than wanting us to
give you one) you are not helping us answer your question.
Interpreting the output depends at least on: (1) the input; and (2)
the operations performed on that input. You have not shown the input.
You have not said what formulas have been applied to or what
operations have performed on that input. Do you want to compute the
long-run steady-state probabilities? Do you want to compute an
expected average or discounted cost over an infinite time horizon? Do
you want to compute first-passage probabilities, or expected first
passage times? Do you want to know the state-space structure
(absorbing states, persistent states, periodicity, etc.)? Do you want
to compute absorption probabilities? What do you want to know? How can
we possibly answer your question without knowing what you want? Why
don't you either write up the problem, or include in the message an
edited version of the GAMS listing (not showing all the "internal"
stuff that GAMS needs---just showing the input, the model, and the
numerical outputs)?

R.G. Vickson
Adjunct Professor, University of Waterloo

erwin

unread,
May 18, 2008, 7:54:06 PM5/18/08
to


$ontext
Given a Markov transition matrix, find the steady state
probabilities p(i).
Janeth Ngana, 2008
$offtext
set i 'states' /state1*state8/;
alias (i,j);
table A(i,j) 'transition matrix'
state1 state2 state3 state4 state5 state6
state7 state8
state1 0.0321
state2 0.9612 0.0209
state3 0.9686 0.0143
state4 0.9726 0.1229
state5 0.8587 0.0005
state6 0.9828 0.0001
state7 0.9770
0.0028
state8 0.0067 0.0105 0.0131 0.0184 0.0167 0.0229
0.9972 1.0000
;
variables
dummy 'dummy objective variable'
p(i) 'steady state probabilities'
;
positive variables p;
p.up(i) = 1;

equations
steadystate(i)
normalize
edummy
;

steadystate(i).. sum(j, A(i,j)*p(j)) =e= p(i);
normalize.. sum(i, p(i)) =e= 1;
edummy.. dummy =e= 0;

model m1 /steadystate,normalize,edummy/;
solve m1 minimizing dummy using lp;


The result is:

---- VAR p steady state probabilities

LOWER LEVEL UPPER MARGINAL

state1 . . 1.0000
EPS
state2 . . 1.0000
EPS
state3 . . 1.0000
EPS
state4 . . 1.0000
EPS
state5 . . 1.0000
EPS
state6 . . 1.0000
EPS
state7 . . 1.0000
EPS
state8 . 1.0000
1.0000 .


So this means that in the long term the system is always in state8.

Note: you may want to add:

display p.l;

at the bottom of the model. That will show:

---- 36 VARIABLE p.L steady state probabilities

state8 1.000

Only the nonzero values are shown.

Erwin

----------------------------------------------------------------
Erwin Kalvelagen
Amsterdam Optimization Modeling Group
erwin.ka...@gmail.com, http://www.gams.com/~erwin
http://amsterdamoptimization.com
----------------------------------------------------------------

janet...@yahoo.com

unread,
May 19, 2008, 5:51:06 AM5/19/08
to

Thank you Sir.

THIS IS THE INPUT$ontext

THIS IS THE OUTPUT

GAMS Rev 146 x86/MS Windows 05/19/08
12:38:10 Page 3
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Column Listing SOLVE m1 Using LP From line 34


---- dummy ’dummy objective variable’

dummy
(.LO, .L, .UP = -INF, 0, +INF)
1 edummy


---- p ’steady state probabilities’

p(state1)
(.LO, .L, .UP = 0, 0, 1)
-0.9679 steadystate(state1)
0.9612 steadystate(state2)
0.0067 steadystate(state8)
1 normalize

p(state2)
(.LO, .L, .UP = 0, 0, 1)
-0.9791 steadystate(state2)
0.9686 steadystate(state3)
0.0105 steadystate(state8)
1 normalize

p(state3)
(.LO, .L, .UP = 0, 0, 1)
-0.9857 steadystate(state3)
0.9726 steadystate(state4)
0.0131 steadystate(state8)
1 normalize

REMAINING 5 ENTRIES SKIPPED
GAMS Rev 146 x86/MS Windows 05/19/08
12:38:10 Page 4
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Model Statistics SOLVE m1 Using LP From line 34


MODEL STATISTICS

BLOCKS OF EQUATIONS 3 SINGLE EQUATIONS 10
BLOCKS OF VARIABLES 2 SINGLE VARIABLES 9
NON ZERO ELEMENTS 29


GENERATION TIME = 0.015 SECONDS 4 Mb WIN223-146 Nov
21, 2006


EXECUTION TIME = 0.015 SECONDS 4 Mb WIN223-146 Nov
21, 2006
GAMS Rev 146 x86/MS Windows 05/19/08
12:38:10 Page 5
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Solution Report SOLVE m1 Using LP From line 34


S O L V E S U M M A R Y

MODEL m1 OBJECTIVE dummy
TYPE LP DIRECTION MINIMIZE
SOLVER CPLEX FROM LINE 34

**** SOLVER STATUS 1 NORMAL COMPLETION
**** MODEL STATUS 1 OPTIMAL
**** OBJECTIVE VALUE 0.0000

RESOURCE USAGE, LIMIT 0.031 1000.000
ITERATION COUNT, LIMIT 0 10000

GAMS/Cplex Nov 27, 2006 WIN.CP.NA 22.3 032.035.041.VIS For Cplex
10.1
Cplex 10.1.0, GAMS Link 32

Optimal solution found.
Objective : 0.000000


---- EQU steadystate

LOWER LEVEL UPPER MARGINAL

state1 . . . .
state2 . . . .
state3 . . . .
state4 . . . .
state5 . . . .
state6 . . . .
state7 . . . .
state8 . . . .

LOWER LEVEL UPPER MARGINAL

---- EQU normalize 1.000 1.000 1.000 EPS
---- EQU edummy . . . 1.000

LOWER LEVEL UPPER MARGINAL

---- VAR dummy -INF . +INF .

dummy ’dummy objective variable’

---- VAR p ’steady state probabilities’

LOWER LEVEL UPPER MARGINAL

state1 . . 1.000 EPS
state2 . . 1.000 EPS
state3 . . 1.000 EPS
state4 . . 1.000 EPS
state5 . . 1.000 EPS
state6 . . 1.000 EPS
state7 . . 1.000 EPS
state8 . 1.000 1.000 .


**** REPORT SUMMARY : 0 NONOPT
0 INFEASIBLE
0 UNBOUNDED

Thanks.
Jane.

janet...@yahoo.com

unread,
May 19, 2008, 5:54:52 AM5/19/08
to
> erwin.kalvela...@gmail.com,http://www.gams.com/~erwinhttp://amsterdamoptimization.com
> ----------------------------------------------------------------

THANK YOU SIR.

Ray Vickson

unread,
May 19, 2008, 12:09:38 PM5/19/08
to

Note that you have written the transition matrix in such a way that
columns sum to 1; that is, your A(i,j) is the usual P(j,i) of Markov
chain theory. (In other words, your usage is different from 99% of the
rest of the world.) Anyway, look at A(8,8) = 1; this means that '8' is
an absorbing state; once the system reaches state 8, it stays there
forever. Also, since A(8,j) > 0 for all j < 8, when the system is in
ANY state j there is a positive probability of reaching state 8 on the
next step. Altogether, then, we can be absolutely sure that the system
WILL reach state 8 eventually, and will then stay there forever (a
fact that is proven in Markov chain theory, but is also highly
intuitive). That means that the long-run probability of state 8 must
be 1.0. ***No calculations are needed to get this conclusion.*** In
your case, though, the GAMS model DID give a correct, well-
interpretable result, but I can come up with other examples in which
the output is nonsense; that is, GAMS would correctly compute a result
that has no meaning because the model is all wrong.

R.G. Vickson

janet...@yahoo.com

unread,
May 25, 2008, 8:52:58 AM5/25/08
to
> erwin.kalvela...@gmail.com,http://www.gams.com/~erwinhttp://amsterdamoptimization.com
> ----------------------------------------------------------------

Hello Sir!!
Could you please help me with the interpretation of my two results on
GAMS.Which results do you think is more logical?
INPUT


$ontext
Given a Markov transition matrix, find the steady state
probabilities p(i).
Janeth Ngana, 2008
$offtext
set i ’states’ /state1*state8/;
alias (i,j);
table A(i,j) ’transition matrix’
state1 state2 state3 state4
state5 state6 state7 state8

state1 0.032161
0.961177
0.006662
state2 0.020891
0.968575
0.010534
state3 0.014251
0.972613 0.013136
state4 0.122902
0.858722 0.018376
state5
0.000486 0.982528 0.016986
state6
0.000051 0.977095 0.022854
state7
0.000065 0.022980
state8
1.000000


;
variables
dummy ’dummy objective variable’
p(i) ’steady state probabilities’
;
positive variables p;
p.up(i) = 1;
equations
steadystate(i)
normalize
edummy
;
steadystate(i).. sum(j, A(i,j)*p(j)) =e= p(i);
normalize.. sum(i, p(i)) =e= 1;
edummy.. dummy =e= 0;
model m1 /steadystate,normalize,edummy/;
solve m1 minimizing dummy using lp;

OUTPUT


S O L V E S U M M A R Y

MODEL m1 OBJECTIVE dummy
TYPE LP DIRECTION MINIMIZE
SOLVER CPLEX FROM LINE 34

**** SOLVER STATUS 1 NORMAL COMPLETION
**** MODEL STATUS 1 OPTIMAL
**** OBJECTIVE VALUE 0.0000

RESOURCE USAGE, LIMIT 0.090 1000.000


ITERATION COUNT, LIMIT 0 10000

GAMS/Cplex Nov 27, 2006 WIN.CP.NA 22.3 032.035.041.VIS For Cplex
10.1
Cplex 10.1.0, GAMS Link 32

Optimal solution found.
Objective : 0.000000


---- EQU steadystate

LOWER LEVEL UPPER MARGINAL

state1 . . . EPS
state2 . . . EPS
state3 . . . EPS
state4 . . . EPS
state5 . . . EPS
state6 . . . EPS
state7 . . . EPS

LOWER LEVEL UPPER MARGINAL

---- EQU normalize 1.000 1.000 1.000 EPS
---- EQU edummy . . . 1.000

LOWER LEVEL UPPER MARGINAL

---- VAR dummy -INF . +INF .

dummy ’dummy objective variable’

---- VAR p ’steady state probabilities’

LOWER LEVEL UPPER MARGINAL

state1 . 0.072 1.000 .
state2 . 0.068 1.000 .
state3 . 0.062 1.000 .
state4 . 0.054 1.000 .
state5 . 0.041 1.000 .
state6 . 0.030 1.000 .
state7 . 0.015 1.000 .
state8 . 0.659 1.000 .


**** REPORT SUMMARY : 0 NONOPT
0 INFEASIBLE
0 UNBOUNDED


and
INPUT


$ontext
Given a Markov transition matrix, find the steady state
probabilities p(i).
Janeth Ngana, 2008
$offtext
set i ’states’ /state1*state8/;
alias (i,j);
table A(i,j) ’transition matrix’
state1 state2 state3 state4
state5 state6 state7 state8

state1 0.032161
0.961177
0.006662
state2 0.020891
0.968575
0.010534
state3 0.014251
0.972613 0.013136
state4 0.122902
0.858722 0.018376
state5
0.000486 0.982528 0.016986
state6
0.000051 0.977095 0.022854
state7
0.002818 0.997182
state8
1.000000


;
variables
dummy ’dummy objective variable’
p(i) ’steady state probabilities’
;
positive variables p;
p.up(i) = 1;
equations
steadystate(i)
normalize
edummy
;
steadystate(i).. sum(j, A(i,j)*p(j)) =e= p(i);
normalize.. sum(i, p(i)) =e= 1;
edummy.. dummy =e= 0;
model m1 /steadystate,normalize,edummy/;
solve m1 minimizing dummy using lp;

OUTPUT

S O L V E S U M M A R Y

MODEL m1 OBJECTIVE dummy
TYPE LP DIRECTION MINIMIZE
SOLVER CPLEX FROM LINE 34

**** SOLVER STATUS 1 NORMAL COMPLETION
**** MODEL STATUS 1 OPTIMAL
**** OBJECTIVE VALUE 0.0000

RESOURCE USAGE, LIMIT 0.110 1000.000


ITERATION COUNT, LIMIT 0 10000

GAMS/Cplex Nov 27, 2006 WIN.CP.NA 22.3 032.035.041.VIS For Cplex
10.1
Cplex 10.1.0, GAMS Link 32

Optimal solution found.
Objective : 0.000000


---- EQU steadystate

LOWER LEVEL UPPER MARGINAL

state1 . . . EPS
state2 . . . EPS
state3 . . . EPS
state4 . . . EPS
state5 . . . EPS
state6 . . . EPS
state7 . . . EPS

LOWER LEVEL UPPER MARGINAL

---- EQU normalize 1.000 1.000 1.000 EPS
---- EQU edummy . . . 1.000

LOWER LEVEL UPPER MARGINAL

---- VAR dummy -INF . +INF .

dummy ’dummy objective variable’

---- VAR p ’steady state probabilities’

LOWER LEVEL UPPER MARGINAL

state1 . 0.125 1.000 .
state2 . 0.125 1.000 .
state3 . 0.125 1.000 .
state4 . 0.125 1.000 .
state5 . 0.125 1.000 .
state6 . 0.125 1.000 .
state7 . 0.125 1.000 .
state8 . 0.125 1.000 .

janet...@yahoo.com

unread,
May 25, 2008, 8:58:54 AM5/25/08
to

Hello Prof.!!!

0 new messages