~/anaconda3/lib/python3.9/site-packages/pyphi/actual.py in find_actual_cause(self, mechanism, purviews)
435 def find_actual_cause(self, mechanism, purviews=False):
436 """Return the actual cause of a mechanism."""
--> 437 return self.find_causal_link(Direction.CAUSE, mechanism, purviews)
438
439 def find_actual_effect(self, mechanism, purviews=False):
~/anaconda3/lib/python3.9/site-packages/pyphi/actual.py in find_causal_link(self, direction, mechanism, purviews, allow_neg)
426 else:
427 # This max should be most positive
--> 428 max_ria = max(self.find_mip(direction, mechanism, purview,
429 allow_neg)
430 for purview in purviews)
~/anaconda3/lib/python3.9/site-packages/pyphi/actual.py in <genexpr>(.0)
426 else:
427 # This max should be most positive
--> 428 max_ria = max(self.find_mip(direction, mechanism, purview,
429 allow_neg)
430 for purview in purviews)
~/anaconda3/lib/python3.9/site-packages/pyphi/actual.py in find_mip(self, direction, mechanism, purview, allow_neg)
342 partitioned_probability = self.partitioned_probability(
343 direction, partition)
--> 344 alpha = log2(probability / partitioned_probability)
345
346 # First check for 0
~/anaconda3/lib/python3.9/site-packages/pyphi/actual.py in log2(x)
40 def log2(x):
41 """Rounded version of ``log2``."""
---> 42 return round(_log2(x), config.PRECISION)
43
44
ValueError: math domain error
I know it's more likely that I'm doing something inappropriate, but I did not understand what ...
Also if:
transition.find_actual_cause((K, K))
then ...
CausalLink
α = 0.413 [A, C, D] ◀━━ [K, K]
why? whether alpha smaller than 10 ** (- constant.epsilon), should returnalpha = 0.0 and:
Now I see that this is due to a mess of me. I declared an unlikely Y_state when conditioning to the previous state X_state and this resulted in the described error.
following the guidelines in https://pyphi.readthedocs.io/en/latest/examples/actual_causation.html:
transition = actual.Transition(network, X_state, Y_state, X, Y)
everything happens normally but when I do:
>>> transition.find_actual_cause((B, C))
or
get error:
I know it's more likely that I'm doing something inappropriate, but I did not understand what ...
Also if:
transition.find_actual_cause((K, K))
then ...
why? whether
alpha
smaller than10 ** (- constant.epsilon)
, should returnalpha = 0.0
and: