3
$\begingroup$

I have been asked to calculate "the variance of the number of points" in the following pictures, inside the circles:

enter image description here

I was looking for the definition of "the variance of the number of points" in the literature, which I found this one:

The variance of a set of points is the sum of the squares of the distances from each point to the centroid of the set.

Is this the correct definition of "the variance of the number of points"? (Intuitively, one also expects the division by the number of points, which is absent in this definition.)

EDIT

The pictures are taken from here. For example, it says the variance of the number of points in the left picture scales as $R^2$, but it doesn't give any definition of the variance of the number of points and how it is calculated.

$\endgroup$
3
  • 1
    $\begingroup$ Please say a bit more about the request to calculate "the variance of the number of points" inside each circle. If all you care about is the number of points within each of the indicated circles there are no variances, as it's just a fixed number for each circle. If the question is about the variance of the numbers among those those 3 circles, the standard variance formula for 3 observations would apply. Or perhaps the question is about the variance among all the possible locations of the circles on the squares. Please edit the question to add that information, as comments can be lost. $\endgroup$
    – EdM
    Commented Sep 6, 2021 at 18:59
  • $\begingroup$ Are you just measuring how many points are inside the circle and seeing the variance of that random variable when the circle is drawn over and over. This is interesting, and I might post a simulation once I get the groceries put away. $\endgroup$
    – Dave
    Commented Sep 6, 2021 at 20:33
  • $\begingroup$ I did a simulation of what I thought you were asking, but I am not sure how useful it will be. In any event, I do not think this question can be answered without knowing what “variance” means. You said you have been asked to do a calculation. Who asked you? Client? Professor? $\endgroup$
    – Dave
    Commented Sep 6, 2021 at 21:22

3 Answers 3

3
$\begingroup$

The answer is in a paper by Torquato on hyperuniformity, linked from the Wikipedia page that you cite. In 2 dimensions as in your diagram, it's the variance of the number of particles among multiple random circles of radius $R$ (taken from within a very large area, not a limited area as might be implied by the squares in your diagram).

It's the standard formula for the variance: the difference between the mean of the square of the number of particles and the square of the mean number of particles. Quoting from page 4 of the paper:

the number variance $\sigma_N^2(R) \equiv \left< N(R)^2\right> - \left< N(R)\right>^2.$

The statistical issue here is that for a Poisson distribution, with independence among all the particles, the number variance equals the mean value. In that case, as the sampled area increases with $R^2$, both the mean number of particles and the variance scale with $R^2$. With a hyperuniform distribution, the variance of the number of particles scales more slowly than that. This can be extended to any d-dimensional Euclidean space.

Your far left example seems to be designed to represent a Poisson distribution. The center example is evidently a hyperuniform but not completely regular distribution; to calculate its variance you would need to know a formula for the distribution or have a simulation. The rightmost example is for a uniform square lattice; Torquato notes that the variance then scales approximately with $R^{d-1}$ (with $R$ in your 2-dimensional case), as the fluctuations among sample are mostly near the boundaries of the sampled regions.

$\endgroup$
4
  • $\begingroup$ @Eternity it's both. You start with one value of $R$, move the circle around, and get the variance among multiple placements of the circle. That's the simple answer to your question. Then, to demonstrate hyperuniformity, change the radius $R$, repeat the process, and see how the variance calculated for a series of $R$ values scales with $R$. $\endgroup$
    – EdM
    Commented Sep 7, 2021 at 1:35
  • $\begingroup$ Disagree with the statement: "The center example is evidently a hyperuniform but not completely regular distribution; to calculate its variance you would need to know a formula for the distribution or have a simulation." which highlights the paper's overly narrow definition of spatial variability. It is more generally defined as a "quantity". If you reject this argument, then since there is no distribution formula or way to simulate it, there is no answer for the example discussed. Not likely correct as I have suggested a metric for possible comparative variability assessment, but good paper. $\endgroup$
    – AJKOER
    Commented Sep 8, 2021 at 2:19
  • $\begingroup$ Also a singular focus on Euclidian geometry! If mean is replace median (as in the Laplace distribution), variance is replaced with the range (which is actually cited in the Wikipedia article I referenced, as a valid metric for spatial variability!) Note, my suggested answer is inclusive of this view.. Do you agree EdM, the cited reference is perhaps a bit narrow in perspective? $\endgroup$
    – AJKOER
    Commented Sep 8, 2021 at 2:38
  • $\begingroup$ @AJKOER I have enough trouble just with Euclidean geometry in more than 3 dimensions. I don't feel competent to suggest that a paper on hyperuniformity should have taken a broader perspective on geometries. $\endgroup$
    – EdM
    Commented Sep 8, 2021 at 14:43
3
$\begingroup$

I am hopeful that the following code and resulting graph will be helpful. I believe that what you're reading is spreading the points over a wide area and varying where the circle is centered. I believe that it is equivalent to keeping the circle centered at the origin and drawing repeated samples of points. (Do you see why?) If you deviate from independent and uniform marginal distributions along the axes, then there would have to be modifications.

library(ggplot2)
library(dplyr)
set.seed(2021)
N <- 5000 # Number of points in the square [-10, 10] x [-10, 10]
B <- 1000 # Number of times to sample per circle radius
Rs <- seq(0.01, 1, 0.01) # Circle radii
L <- list() # Empty list to hold data frames produced in the upcoming loop
# Loop over the circle radii
#
for (i in 1:length(Rs)){
  
  n_points <- rep(NA, B) # Blank vector to hold number of points within the circle of radius Rs[i], centered at (0, 0)
  
  # Loop B-many times
  #
  for (j in 1:B){
    
    # Sample from independent U(-10, 10) distributions
    #
    x <- runif(N, -10, 10)
    y <- runif(N, -10, 10)
    rs <- sqrt(x^2 + y^2)

    # Count how many points are within the circle of radius Rs[i], centered at (0, 0)
    #
    n_points[j] <- length(which(rs <= Rs[i]))
    
    
  }
  
  # Made one-row data frames of the radius and either variance or mean number of points
  # Add to list L
  # 
  L[[i]] = data.frame(Radius = Rs[i], Value = mean(n_points), Moment = "Mean")
  L[[i + 1*length(Rs)]] = data.frame(Radius = Rs[i], Value = var(n_points), Moment = "Variance")
  # L[[i + 2*length(Rs)]] = data.frame(Radius = Rs[i], Value = sd(n_points), Moment = "Standard Deviation")
  
  if (i %% 5 == 0 | i < 5){
    print(paste(i/length(Rs) * 100, "% complete", sep = ""))
  }
}

# Concatenate the data frames in L 
#
d <- bind_rows(L)

# Plot
#
ggplot(d, aes(x = Radius, y = Value, col = Moment)) +
  geom_line() +
  geom_point() +
  # facet_grid(~Moment, scales = "free_y") +
  theme_bw()

enter image description here

As EdM discussed, the Poisson distribution has equal mean and variance. The graph above almost has equal means and variances, but not quite, so the distribution is not Poisson, right? No! Those are the sample means and sample variances, where we expect some sampling variation. That both follow about the same curve tells me that the population mean and variance are about equal. Something Poisson or at least nearly Poisson seems quite plausible.

(Poisson makes sense to me if there is independence between the axes and uniform marginal distributions. You're essentially asking how many particles are going to pass through a circle, which is what the Poisson distribution is.)

Perhaps you can use some of what I did here to make your own simulation. Particularly if you're showing this to a friend, you may create stronger evidence by running simulations and presenting graphs than by writing a formal mathematical proof; many people like pictures.

$\endgroup$
1
  • $\begingroup$ I do not completely agree that "I believe that it is equivalent to keeping the circle centered at the origin and drawing repeated samples of points." in tune with the definition of Spatial Variability. Have you glanced at a text on Spatial Statistics, you may be surprised. $\endgroup$
    – AJKOER
    Commented Sep 7, 2021 at 0:00
1
$\begingroup$

Per Wikipedia on to quote:

Spatial variability occurs when a quantity that is measured at different spatial locations exhibits values that differ across the locations. Spatial variability can be assessed using spatial descriptive statistics...

In accord with the above, a sampling scheme that may assist is as follows:

  1. Draw a horizontal diameter (an x-axis) for each circle.

  2. Fit a simple linear (two-parameter) regression model (Least-Squares or perhaps a robust Least-Absolute Deviations model) to predict the x-values (dependent variable) versus the # of the point in the sample (independent variable) as they occur and happen to fall on the diameter.

  3. Select one of the usual goodness-of-fit metrics for the regression model.

  4. Rank the circles based on the chosen comparative statistic.

Arguably, a valid spatial variability analysis concurrent with the definition provided above, as to quote, "a quantity that is measured at different spatial locations exhibits values that differ across the locations". Note, clearly an extension from the recommended mean model (which recommended the employment of the distance formula) as compared to a linear model. Likely, in my opinion, more informative than a mean model and executed with a sampling design that is a de facto data-reduction technique (often necessary).

$\endgroup$
1
  • $\begingroup$ This answer misses the point. The question asks one to understand and assess the variance in the number of points in a moving neighborhood average of a stationary point process. That is neither assessed with a regression model nor by ranking. $\endgroup$
    – whuber
    Commented Sep 8, 2021 at 16:04

Your Answer

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