rms_s2s#
- pymovements.measure.samples.rms_s2s(column: str = 'position', *, n_components: int = 2) Expr[source]#
Root-mean-square of sample-to-sample displacements.
The RMS-S2S (Root Mean Square - Sample to Sample) measures the magnitude of displacements between successive samples. It is computed as the square root of the mean squared Euclidean distance between all adjacent sample pairs:
\[\theta_i = \sqrt{(x_{i+1} - x_i)^2 + (y_{i+1} - y_i)^2}\]\[\text{RMS-S2S} = \sqrt{\frac{1}{n-1} \sum_{i=1}^{n-1} \theta_i^2}\]where \(x_i\) and \(y_i\) are the x/y components for the \(i\)-th sample, \(x_{i+1}\) and \(y_{i+1}\) refer to the components of the next sample, \(\theta_i\) is the Euclidean distance between successive samples, and \(n\) is the total number of samples.
- Parameters:
- Returns:
The root mean square of sample-to-sample displacements.
- Return type:
pl.Expr
- Raises:
ValueError – If number of components is not 2.
Notes
For a single sample (n=1), there are no successive sample pairs, and this measure returns
Nonesince displacements cannot be computed.RMS-S2S is closely proportional to the average velocity of the signal during fixations, making it a good indicator of slowest detectable eye movements. Unlike
std_rms(), which measures spatial spread, RMS-S2S captures the velocity aspect of signal variability. This makes RMS-S2S particularly useful for assessing what threshold might differentiate eye movements from measurement noise [Niehorster et al., 2020].