Closed dynaryu closed 1 year ago
class "variable" needs to be defined. In Matlab version, a variable is defined by "B" and "value". But to be more user friendly, "B" may be replaced by a dictionary something like "numBasicState = 3" and "compositeState = {'4':['1','2'], '5':['1','3'], '6': ['1','2','3']}" (A user does not have to enter composite states for all possible permutations but is enough define those being used). Then, the code may create a "B" matrix accordingly if it makes computation more efficient.
But this is just my suggestion, and I will leave the final decision to you. Also, please feel free to modify variable names.
Oh and for the current Matlab version, "isCompatible" function is somehow misplaced.. It'd be great if it could be placed correctly in the upcoming python version.
As a test example, we can use this one:
Oh and for the current Matlab version, "isCompatible" function is somehow misplaced.. It'd be great if it could be placed correctly in the upcoming python version.
I put it under cpm.py where Cpm class is defined.
But to be more user friendly, "B" may be replaced by a dictionary something like "numBasicState = 3" and "compositeState = {'4':['1','2'], '5':['1','3'], '6': ['1','2','3']}" (A user does not have to enter composite states for all possible permutations but is enough define those being used).
For the time being, I will try to convert the matlab to Python as it is. Once basic implementation is done, then we can think about how to improve usability further.
As a test example, we can use this one:
Given the test example, can you provide input and output for testing? For instance, isCompatible product sum etc...
Oh by the way, there is a typo in the example. P(X2|H) has p=[0.95 0.05 0.85 0.15]' -- The second element needs be changed from 0.15 to 0.05.