In [1]:
from kmr_stationary import kmr_compute_stationary

In [2]:
a = kmr_compute_stationary(n=4, payoffs=[[4,0], [3,2]], epsilon=0.01) # payoffs = stug hunt game
"""
This  shows
1 states
2 transition matrix
3 stationary distribution
"""
print a


['10000', '01000', '00100', '00010', '00001']
[[ 0.995  0.005  0.     0.     0.   ]
 [ 0.995  0.995  0.005  0.     0.   ]
 [ 0.     0.995  0.995  0.005  0.   ]
 [ 0.     0.     0.005  0.005  0.995]
 [ 0.     0.     0.     0.005  0.995]]
[  9.90000250e-01   4.97487563e-03   2.49993750e-05   2.49993750e-05
   4.97487563e-03]

In [3]:
b = kmr_compute_stationary(n=8, payoffs=[[6,0,0], [5,7,5], [0,5,8]], epsilon=0.01) # payoffs = Young's game
"""
This function shows
1 states
2 transition matrix
3 stationary distribution
"""
print b


['1100000000', '0110000000', '1010000000', '0101000000', '0011000000', '1001000000', '0100100000', '0010100000', '0001100000', '1000100000', '0100010000', '0010010000', '0001010000', '0000110000', '1000010000', '0100001000', '0010001000', '0001001000', '0000101000', '0000011000', '1000001000', '0100000100', '0010000100', '0001000100', '0000100100', '0000010100', '0000001100', '1000000100', '0100000010', '0010000010', '0001000010', '0000100010', '0000010010', '0000001010', '0000000110', '1000000010', '0100000001', '0010000001', '0001000001', '0000100001', '0000010001', '0000001001', '0000000101', '0000000011', '1000000001']
[[ 0.99333333  0.00333333  0.00333333 ...,  0.          0.          0.        ]
 [ 0.99333333  0.99333333  0.00333333 ...,  0.          0.          0.        ]
 [ 0.99333333  0.00333333  0.99333333 ...,  0.          0.          0.        ]
 ..., 
 [ 0.          0.          0.         ...,  0.00333333  0.99333333  0.        ]
 [ 0.          0.          0.         ...,  0.00333333  0.99333333  0.        ]
 [ 0.          0.          0.         ...,  0.          0.          0.99333333]]
[  8.64279440e-03   2.90024683e-05   2.90028632e-05   9.73690885e-08
   9.70795829e-08   9.74797670e-08   3.37611995e-10   4.05885529e-10
   1.63157080e-10   4.71708710e-10   2.28140189e-11   4.21694833e-11
   8.20546835e-11   4.10741904e-13   1.25397198e-10   1.45238391e-10
   4.19490592e-11   4.11336640e-11   4.10518664e-13   1.37652017e-15
   3.71047955e-08   3.72333030e-08   1.55905315e-10   2.11399178e-11
   3.09667971e-13   1.89239215e-15   6.10093888e-18   1.10879037e-05
   1.10880037e-05   3.72287746e-08   1.35357907e-10   6.25493942e-13
   3.21242091e-15   1.51441348e-17   3.64304995e-16   3.30421826e-03
   3.30421836e-03   1.10880125e-05   3.72188338e-08   1.25137769e-10
   4.22414559e-13   1.43026230e-15   3.69020761e-16   1.09265538e-13
   9.84657057e-01]

In [ ]: