pymovements.events.dispersion#

pymovements.events.dispersion(*, position_column: str = 'position', n_components: int = 2) Expr[source]#

Dispersion of an event.

The dispersion is calculated as:

\[\text{Dispersion} = x_{\text{max}} - x_{\text{min}} + y_{\text{max}} - y_{\text{min}}\]

where \((x_{\text{min}},\; x_{\text{max}})\) and \((y_{\text{min}},\; y_{\text{max}})\) are the minimum and maximum values of the \(x\) and \(y\) components of the gaze positions during an event.

Parameters:
  • position_column – The column name of the position tuples.

  • n_components – Number of positional components. Usually these are the two components yaw and pitch.

Raises:

ValueError – If number of components is not 2.