1
0
Fork 0
Old engine for Continuous Time Bayesian Networks. Superseded by reCTBN. 🐍 https://github.com/madlabunimib/PyCTBN
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
PyCTBN/main_package/classes/conditional_intensity_matri...

14 lines
530 B

import numpy as np
class ConditionalIntensityMatrix:
def __init__(self, dimension):
self.state_residence_times = np.zeros(shape=(1, dimension))
self.state_transition_matrix = np.zeros(shape=(dimension, dimension), dtype=int)
self.cim = np.zeros(shape=(dimension, dimension), dtype=float)
def update_state_transition_count(self, positions_list):
self.state_transition_matrix[positions_list[0]][positions_list[1]] = self.state_transition_matrix[positions_list[0]][positions_list[1]] + 1