data("EMMTraffic")
## For the example we use a very high learning rate
emm_l <- EMM(measure="eJaccard", threshold=0.2, lambda = 1)
emm_l <- build(emm_l, EMMTraffic)
## show state counts and transition counts
state_counts(emm_l)
transition_matrix(emm_l, type="counts")
## remove all states and edges with a threshold of 0.1
rare_states(emm_l, count_threshold=0.1)
rare_transitions(emm_l, count_threshold=0.1)
emm_lr <- prune(emm_l, count_threshold=0.1)
## compare graphs
op <- par(mfrow = c(1, 2), pty = "m")
plot(emm_l, method = "graph", main = "EMM with high learning rate")
plot(emm_lr, method = "graph", main = "Simplified EMM")
par(op)
Run the code above in your browser using DataLab