-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Periodicity of DiGraph/MarkovChain #245
Comments
For example, what period do we want to say the following Markov chain has? P = [[0, 0.5, 0, 0, 0.5],
[0, 0, 0.5, 0, 0.5],
[0.5, 0, 0, 0, 0.5],
[0, 0, 0, 0, 1],
[0, 0, 0, 1, 0]] My argument is that the communication class What about the digraph defined by the above matrix? In a digraph there is no concept of transience, so But actually in the |
And what about this? Q = [[0, 1, 0, 0, 0],
[0, 0, 1, 0, 0],
[1, 0, 0, 0, 0],
[0, 0, 0, 0, 1],
[0, 0, 0, 1, 0]] Should the period of the Markov chain/digraph be 6, 1, or undefined? |
OK, I remember better now. You thought about all of this very carefully. My comment in #237 (thanks for opening a new issue) is mainly about the error, which to the casual user of the code makes it seem like the code is broken. It's not, but that's a likely impression. What do you think about returning the string "undefined" instead? Regarding the specific cases, I don't mind too much what convention we adopt. As you say, it's possible to make arguments from different perspectives. (From what I saw in a quick read, for a digraph, gcd of the length of the cycles = 1 seemed like a common definition of aperiodicity, while for finite MCs, all states aperiodic seems like the standard definition of aperiodicity.) |
What if the user uses it in a script with try:
d = g.period
except NotImplementedError:
... |
@oyamad I'm not sure, to be honest. I guess it felt strange that I got an error message when I requested a property. That's why it felt like the implementation was broken. It seems like if there's a property I should be able to access it without getting an error message. So I prefer the string "undefined". But I can see your point of view too. If you are happy with it the way it is you can close this issue. |
To me it seems natural that, given that it is left undefined for a reducible Markov chain, the period is not implemented and when it is accessed a |
I think it is better to explicitly raise NotImplementedError (possibly with On Wed, Apr 13, 2016 at 2:07 PM, Daisuke Oyama [email protected]
|
The text was updated successfully, but these errors were encountered: