Fix Error: "ValueError: Rows of transmat must sum to 1.0"

inf in stat['trans'] is the cause of this error.