Let's suppose that we have a set of $N$ $d$-dimensional points, equivalently a set of vectors $\{\mathbf{x}_i\in\mathbb{R}^d, i=1,\ldots,N\}$, where typically $N<d$.
My objective is to measure the "linearity" of the path that those points form if we connect each point to its next (wrt its index $i$), starting from $i=1$ and stopping at $i=N$.
One solution that I came up with is to naively calculate the rank of the $d\times N$ matrix $$ X = \begin{bmatrix} \vert & & \vert \\ \mathbf{x}_1 & \cdots & \mathbf{x}_N \\ \vert & & \vert \end{bmatrix} \in\mathbb{R}^{d\times N}, $$ $\operatorname{rank}(X)$, and take $$ r = \frac{N-\operatorname{rank}(X)}{N}. $$ This way, when $\operatorname{rank}(X)=N$, i.e., when all $N$ vectors are linearly independent, $r$ takes its minimum value, $r=0$, and the path of points is "non-linear". On the other hand, when $\operatorname{rank}(X)=1$, $r$ takes its maximum value, $r = \frac{N-1}{N}$, and the path is "linear", i.e., all points lie on a straight line. As a side note, I find it frustrating that I cannot find a measure that takes 1 as its maximum value.
Now, this is a bad choice, since it could be the case that just on vector, at the middle of the path, for instance, could be perpendicular to its previous (will all the rest being co-linear), making the path "turn", but $r$ would still indicate high "linearity".
My question is if there is a correct way to measure the linear correlation between the given points. I was also thinking of using Pearson correlation coefficient (for each pair of dimensions of $X$, maybe), but I don't know if this is going to lead to any meaningful direction. A Pearson correlation coefficient for multidimensional points would be exactly what I need, but I'm not aware of any high-dimensional variant.