Quantifying plots

Quantify time in each state

# Like plot_quantify() this method will quantify how much of the time each specimen is within each state.


df.plot_hmm_quantify(
hmm = [hv, he, hw, hs, hy], 
variable = 'moving', 
facet_labels = ['D.virilis', 'D.erecta', 'D.willistoni', 'D.sechellia', 'D.yakuba']
facet_col = 'species',
facet_arg = ['D.vir', 'D.ere', 'D.wil', 'D.sec', 'D.yak'],
bin = [60, 60, 60, 60, 60]
)
An example plot from the plot hmm quantify method

Quantifying length of each state

Its a good idea to look at the length of each state to gain an understanding of how the model is separating your data. There are two length methods 1) one to plot the mean lengths per state per specimen and 2) a plot to show the maximum and minimum state length per group.

# all hmm quantifying plots have the same parameters, so just change the method name and you're good to go

df.plot_hmm_quantify_length(
hmm = [hv, he, hw, hs, hy], 
variable = 'moving', 
facet_labels = ['D.virilis', 'D.erecta', 'D.willistoni', 'D.sechellia', 'D.yakuba']
facet_col = 'species',
facet_arg = ['D.vir', 'D.ere', 'D.wil', 'D.sec', 'D.yak'],
bin = [60, 60, 60, 60, 60]
)
An example plot from the hmm quantify length plot
# The length min/max method only shows the the min and maximum points as a box

df.plot_hmm_quantify_length_min_max(
hmm = [hv, he, hw, hs, hy], 
variable = 'moving', 
facet_labels = ['D.virilis', 'D.erecta', 'D.willistoni', 'D.sechellia', 'D.yakuba']
facet_col = 'species',
facet_arg = ['D.vir', 'D.ere', 'D.wil', 'D.sec', 'D.yak'],
bin = [60, 60, 60, 60, 60]
)

# Below you can see when the model seperates light sleep from deep sleep 
An example plot from the hmm quantify length plot, min/max

Quantifying transitions

The time in each state and the average length are good overview stats, but can be misleading about how often a state occurs if the state is short. This next method quantifies the amount of times a state is transitioned into, effectively counting the instances of the state regardless of time


df.plot_hmm_quantify_transition(
hmm = [hv, he, hw, hs, hy], 
variable = 'moving', 
facet_labels = ['D.virilis', 'D.erecta', 'D.willistoni', 'D.sechellia', 'D.yakuba']
facet_col = 'species',
facet_arg = ['D.vir', 'D.ere', 'D.wil', 'D.sec', 'D.yak'],
bin = [60, 60, 60, 60, 60]
)
An example plot from the hmm quantify transitions plot

Last updated