-
Notifications
You must be signed in to change notification settings - Fork 39
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
markovchainfit on a list doesn't identify the absorbing state #155
Comments
Hi @ChristelSwift, we will check and tell |
@ChristelSwift I do think there is an error and the matrix should be:
In fact the matrix we output is not even stochastic. And |
@ncordon yes that's right, the last row of the matrix should be as you describe, but the estimate comes out as a row of zeros (not of ones as i originally wrote). |
@ChristelSwift , the reason is that e is the last element of some sequence and there is no possible transition to learn from. If "e" would be an absorbing state we would have expected all occurrences of "e" followed by "e". @ncordon , as discussed yesterday, we can add an option to the markovchainFit function (the name of the options still to be determined, maybe, no_transitions_hp, suggestions welcome) with the following options:
|
thanks very much for the explanation. In the meantime all i have to do is repeat the absorbing state twice at the end of each journey which is easily done. thank you! |
I think we should discard the option "zeros". It is not useful from the mathematical point of view. A transition matrix for a markov chain should always be a by-row-stochastic matrix (i.e. each row probabilities sum up to one). In addition, it is something we already check in the constructor of markov chains (that the sum of each row is 1). From my perspective, it does not make sense to output a thing that does not comply with our requirements to be a markov chain. I'm adding the other two possibilities though. |
i'm trying to fit a markov chain from a large list where each element is a customer journey between states. Each journey ends with an "end" state (so "end" is an absorbing state), however in the returned estimated transition matrix, all the entries for the "end" row are zeros, when i would have expected a 1 for the element where row = "end" and column = "end". Am i doing something wrong?
Here's a simple reproducible example:
The text was updated successfully, but these errors were encountered: