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.
|
|
|
import conditional_intensity_matrix as cim
|
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
class AmalgamatedCims:
|
|
|
|
|
|
|
|
def __init__(self, states_number,list_of_keys, list_of_matrices_dims):
|
|
|
|
self.actual_cims = {}
|
|
|
|
self.init_cims_structure(list_of_keys, list_of_matrices_dims)
|
|
|
|
self.states_per_variable = states_number
|
|
|
|
|
|
|
|
def init_cims_structure(self, keys, dims):
|
|
|
|
for key, dim in (keys, dims):
|
|
|
|
self.actual_cims[key] = np.empty(dim, dtype=cim.ConditionalIntensityMatrix)
|
|
|
|
for key in self.actual_cims.keys():
|
|
|
|
for indx in range(len(self.actual_cims[key])):
|
|
|
|
self.actual_cims[key][indx] = cim.ConditionalIntensityMatrix(self.states_per_variable)
|
|
|
|
|
|
|
|
def compute_matrix_indx(self, row, col):
|
|
|
|
return self.state_per_variable * row + col
|