1
$\begingroup$

Given an even number of sample points in a plane, I want to compute the sum of squared distances from the sample center as part of estimating the Rayleigh parameter. One way of doing it is to compute the sample center ($\bar{x}, \bar{y}$), then $r_i = \sqrt{(x_i - \bar{x})^2 + (y_i - \bar{y})^2}$ and then I compute $\sum{r_i^2}$.

It would be very convenient if I could instead just draw the sample points 2 at a time (without replacement), measure their distance $d_{ij} = \sqrt{(x_i - x_j)^2 + (y_i - y_j)^2}$, and find a function f that gives $\sum{r_i^2} = f({d})$.

I've tested a few sets and it appears that $\sum{r^2} = \sum_{i=1, j=n/2+1}^{i=n/2, j=n}\sqrt{\frac{(x_i-x_j)^2+(y_i-y_j)^2}{2}}$ works, but I have not been able to prove this. Is that equation correct?

$\endgroup$
1

1 Answer 1

2
$\begingroup$

By viewing $\{x_1, \ldots, x_n\}$ and $\{y_1, \ldots, y_n\}$ as two separate samples, $\sum r_i^2 = (n - 1)S_x^2 + (n - 1)S_y^2$, where $S_x^2 = (n - 1)^{-1}\sum_{i = 1}^n (x_i - \bar{x})^2$ is the well-known sample variance. So your problem reduces to how to re-express the sample variance as the sum of squared paired differences.

In non-parametric statistics, this formulation is called U-statistic. For sample variance, it is easy to verify that the sample variance is a U-statistic of order-2: \begin{align} S_x^2 = \frac{1}{n - 1}\sum_{i = 1}^n (x_i - \bar{x})^2 = \frac{1}{n(n - 1)}\sum_{1 \leq i \neq j \leq n}\frac{(x_i - x_j)^2}{2}. \tag{1} \end{align}

If you prefer increasing sum indices (as opposed to distinct sum indices), $(1)$ can be clearly rewritten as: \begin{align} S_x^2 = \frac{2}{n(n - 1)}\sum_{1 \leq i < j \leq n}\frac{(x_i - x_j)^2}{2}. \tag{2} \end{align}

Therefore, the quantity of your interest can be written as \begin{align} \sum_{i = 1}^nr_i^2 &= \frac{1}{2n}\sum_{1 \leq i \neq j \leq n}[(x_i - x_j)^2 + (y_i - y_j)^2] \\ &= \frac{1}{n}\sum_{1 \leq i < j \leq n}[(x_i - x_j)^2 + (y_i - y_j)^2]. \end{align}


Proof of (1). Since $x_i - x_j = 0$ when $i = j$, it follows that \begin{align} & \sum_{1 \leq i \neq j \leq n}(x_i - x_j)^2 \\ =& \sum_{i = 1}^n\sum_{j = 1}^n(x_i - x_j)^2 \\ =& \sum_{i = 1}^n\sum_{j = 1}^n[(x_i - \bar{x}) - (x_j - \bar{x})]^2 \\ =& \sum_{i = 1}^n\sum_{j = 1}^n[(x_i - \bar{x})^2 - 2(x_i - \bar{x})(x_j - \bar{x}) + (x_j - \bar{x})^2] \\ =& n\sum_{i = 1}^n(x_i - \bar{x})^2 + 0 + n\sum_{j = 1}^n(x_j - \bar{x})^2 \\ =& 2n(n - 1)S_x^2. \end{align}

$\endgroup$
2
  • $\begingroup$ This works! But what I thought should work requires only n/2 measurements (draw 2 samples at a time, and measure their distance from each other), and this requires (n^2)/2 measurements (distance between every possible point pair). Is a reduction possible in this approach? $\endgroup$
    – feetwet
    Commented May 10, 2023 at 1:26
  • $\begingroup$ @feetwet If you inspect Eq (2), you actually only need to make $\binom{n}{2} = \frac{1}{2}n(n - 1)$ measurements, which is less than $n^2/2$. So it already achieves the maximum reduction. $\endgroup$
    – Zhanxiong
    Commented May 10, 2023 at 1:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.