Description Usage Arguments Details Value Examples
The algorithm 'gazeHMM' for classifying eye-tracking data into eye movement events using a hidden Markov model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
x |
Numeric vector of raw x coordinates for each gaze samples. |
y |
Numeric vector of raw y coordinates for each gaze samples. |
t |
Numeric vector of time stamps for each gaze sample. |
unit |
Character string indicating the unit of coordinates (either 'px' or 'va'). |
res |
Screen resolution (in px). |
dim |
Screen dimensions (in mm). |
dist |
Distance between subject and screen (in mm). |
fr |
Sampling rate of the eye-tracker (in Hz). |
blink |
Either a numeric vector of length two indicating the x and y coordinates for blink samples
or a logical vector with the same length as |
b.win |
Time window around blink samples that are to be ignored (i.e., set to NA; in s). |
sg.order |
Order of the Savitzky-Golay filter. |
sg.length |
Length of the Savitzky-Golay filter (must be odd). |
nstates |
Number of states in the hidden Markov model. |
respstart |
Starting values for the response model in the hidden Markov model. |
trstart |
Starting values for the transition model in the hidden Markov model. |
instart |
Starting values for the initial state model in the hidden Markov model. |
sf |
Vector of length two indicating by which factor velocity and acceleration data will be divided. |
random.respstart |
Logical indicating whether random starting values will be generated for estimating
response parameters using |
start.seed |
Seeds for generating random starting values for response parameters. |
fit.control |
List of settings for the EM algorithm as returned by |
min.sac |
Minimum saccade duration (in s). |
The algorithm consists of a preprocessing, classification, and postprocessing step.
During preprocessing, the raw data x
and y
are first converted into degrees of visual angle (only if unit
was 'px').
Samples classified as blinks by blink
and those surrounding them (by b.win
) are set to NA
.The remaining coordinates
are then used to compute velocity, acceleration, and sample-to-sample angle signals.
Velocity and acceleration are calculated by applying a Savitzky-Golay filter to the sampel coordinates
and the sample-to-sample angle by apply finite forward and backward differences.
In the classification step, a hidden Markov model with velocity, acceleration, and sample-to-sample angle
as dependent variables classifies each sample as belonging to one of nstates
states.
The model describes the velocity and acceleration signals by mixtures of gamma distributions
with shape and scale parameters. Sample-to-sample angle is modeled by a mixture of von Mises distributions
and a uniform distribution. The argument sf
determines by which factor velocities and
accelerations will be divided. Increasing the factor can improve the fitting of the model
(although the default should usually suffice). If instart
or trstart
are not supplied,
uniform starting values will be used (i.e., 1/nstates
).
The postprocessing routine relabels samples that belong to one-sample fixations or smooth pursuits,
saccades with a duration below min.sac
, or PSOs following non-saccade samples.
The respective samples are relabeled as the previous event.
The classification labels correspond to the following events:
Blink/noise
Fixation
Saccade
PSO
Smooth pursuit
A list object of class 'gazeHMM' containing four elements:
Preprocessed gaze data with postprocessed sample labels.
A list with data frames for each classified event containing the event metrics (e.g., fixation duration).
The depmix.fitted
model.
The arguments of gazeHMM
used to obtain results (for reproducibility).
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.