IHMM
- class eyefeatures.preprocessing.fixation_extraction.IHMM(x, y, t, fix2sac=0.05, sac2fix=0.05, fix_distrib='norm', sac_distrib='norm', distrib_params='auto', distance='euc', pk=None, eps=1e-20)[source]
Bases:
BaseFixationPreprocessorHidden Markov Model Identification. Based on Viterbi algorithm. Complexity: O(n^2) for single group.
- Parameters:
fix2sac (float) – probability of transition from fixation to saccade.
sac2fix (float) – probability of transition from saccade to fixation.
fix_distrib (str) – distribution of fixations.
sac_distrib (str) – distribution of saccades.
distrib_params (str | dict[str, float]) – ‘auto’ for default params or dict with {“fixation”: params1, “saccade”: params2}, where “params” are arguments for appropriate scipy.stats function.
x (str)
y (str)
t (str)
distance (str)
eps (float)
Algorithm
The algorithm finds a sequence of fixations that maximizes the log probability of observing given velocities of gazes under conditions of Hidden Markov Model. More formally, denote velocity of \(i\)-th gaze as
This is observed process, while hidden process is sequence \(\{s_i\}_{i=1}^{n}\) of zeros and ones, as mentioned in previous section. Given some fixed prior distribution of velocities (Gaussian is taken as empirical rule) and transition matrix, then, under assumption of Markov process, probability is maximized in greedy manner.
The process is called Markov process if
for some fixed \(k \geq 1\).