Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def compute_markov_transition_probabilities(self):
for i in range(self.k_regimes):
denom = 1
for r in range(self.k_regimes-1):
denom += math.exp(-self.q_matrix[i][r])
for j in range(self.k_regimes-1):
self.gamma_matrix[i][j] = math.exp(-self.q_matrix[i][j])/denom
self.gamma_matrix[i][self.k_regimes-1] = 1.0/denom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment