Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.
import os
from pylab import *
from numpy import *
# get the probabilities of going from one state to another.
data = loadtxt("mat.txt")
data = data.reshape(-1,26)
# chop off the last row and column
# transition probabilities among the transient states
Q = data[0:25,0:25]
# the transition probabilities from transient to absorbing
R = data[0:25,25:26]
#print R
# M = (I-Q)^-1
Matrix = linalg.inv(eye(25)-Q)
# B = M*R
B = Matrix*R
#print B
count = []
for i in Matrix:
sum =0
for m in i:
sum = sum + m
count.append(sum)
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Math home work questions | 5 | 94 | |
linux crontab output | 3 | 73 | |
Made in Japan hybrid 6 or 7 seaters that comes with at least 5m power cord extension to charge from home wall power point | 5 | 63 | |
How to use pyenv | 4 | 36 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!