Skip to content

markovchainfit on a list doesn't identify the absorbing state #155

@ChristelSwift

Description

@ChristelSwift

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:

c1<-c("a","b","c","c","e") 
c2<-c("a","b","d","e") 
c3<-c("a","c","b","c","d") 
c4<-c("a","b","b","d","b","c","d","e") 
c5<-c("a","c","c","d","d") 
c6<-c("a","c","d","d","b","b","e") 

mylist<-list(c1,c2,c3,c4,c5,c6) 
mylistMc<-markovchainFit(data=mylist) 
mylistMc$estimate

mylistMc$estimate
MLE Fit
A 5 - dimensional discrete Markov Chain defined by the following states:
a, b, c, d, e
The transition matrix (by rows) is defined as follows:
a b c d e
a 0 0.5000000 0.500 0.0000000 0.0000000
b 0 0.2500000 0.375 0.2500000 0.1250000
c 0 0.1250000 0.250 0.5000000 0.1250000
d 0 0.3333333 0.000 0.3333333 0.3333333
e 0 0.0000000 0.000 0.0000000 0.0000000

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions