jieunbyun / BNS-JT

Reference: Byun, J.-E. and Song, J. (2021). A general framework of Bayesian network for system reliability analysis using junction tree. Reliability Engineering & System Safety, 216, 107952.
MIT License
5 stars 4 forks source link

Need for "sort" in product #18

Closed jieunbyun closed 1 year ago

jieunbyun commented 1 year ago

I checked the issue with "sort" in "product" function, and it does not seem to play any role. I ran test functions without "sort" operation, and the results were correct although the asserted values need to be changed to reflect the changed orders of variables.

jieunbyun commented 1 year ago

Ahh I found an issue with the Transport example. I will look into it tomorrow.

jieunbyun commented 1 year ago

I confirm that there is NO PROBLEM to remove the "sort" operation. Assertion errors simply occur from the different orderings of variables and rows in CPMs.

But could we make a function that a user can provide a desired order of variables, and the columns are reordered? For now, an inference result is bound to appear as something like ["e1" "e2" "obs1" "obs2" "e3" ...], which might be confusing for post-processing.