std_rms#
- pymovements.measure.samples.std_rms(column: str = 'position', *, n_components: int = 2) Expr[source]#
Root-mean-square standard deviation.
The standard deviation (STD) measures the spatial spread of samples around their centroid. It is computed as the root mean square of the squared standard deviations along the horizontal and vertical directions:
\[\text{STD}_x = \sqrt{\frac{1}{n-1} \sum_{i=1}^{n} (x_i - \bar{x})^2},\quad \text{STD}_y = \sqrt{\frac{1}{n-1} \sum_{i=1}^{n} (y_i - \bar{y})^2}\]\[\text{STD} = \sqrt{\text{STD}_x^2 + \text{STD}_y^2}\]where \(x_i\) and \(y_i\) are the positions for the \(i\)-th sample, and \(\bar{x}\) and \(\bar{y}\) are their respective means. The STD is a radial measure representing the overall spatial extent of the samples around their centroid.
- Parameters:
- Returns:
The radial standard deviation of the samples.
- Return type:
pl.Expr
- Raises:
ValueError – If number of components is not 2.
Notes
This implementation uses sample standard deviation (dividing by \(n-1\)). This is implemented using
ddof=1in the standard deviation calculation.For sequences with a single sample, this measure returns
Nonesince there is no variance to measure.STD is relatively insensitive compared to
rms_s2s()to displacement between successive gaze samples, making it a good measure of spatial spread rather than signal velocity. This makes STD particularly suitable for quantifying the precision of eye trackers as it reflects the area over which gaze positions are distributed during fixations.