Wednesday, February 1, 2023

Mean Islands

 What does the average island look like?

To answer that, we need a very general model for generating islands. The model I am using is the Gaussian Free Field. This is the 2D equivalent of Brownian noise, and it has the property that it is conformal / scale symmetric. In other words, it is a fractal height field very similar to the old plasma fractals used to make fractal landscapes:

In fact the Gaussian Free Field is the mathematically simplest and most invariant such landscape.

All we need to do is set a water level and the result is a set of islands. So what does the average such island look like?

It wouldn't be circular because it is a shape, and shapes are invariant to Euclidean transforms, in other words you need to rotate and pair of islands to best fit, before taking the average of the height field. This is therefore part of my series on mean shapes under symmetries. The first attempt at a mean island looks like this:

The greyscale is the island, with height shown from 50% grey up to white, and the blue is water, showing the depth. It looks like an inverted ellipsoidal paraboloid, i.e. oval shapes, with a length to width ratio of something close to 2  (1.97 above, which merges 2^16 islands).

In order to generate the mean island, I generate a large number of Gaussian Free Fields (2^18) in a fixed square region, then for each pair of fields I find their peak and lower the water level until I get an island of specified area (I'm using 1/20 the area of the GFF). It doesn't matter that I use the highest peak, or what area I choose because the GFF is conformal and all peaks have the same statistical properties. I just can't make the area too large compared to the GFF region. 



Examples of GFF islands. Brightness is height, blue is below water, yellow is the floodfilled island from the highest peak in the map. Red is the centroid and dark red is the centroid plus the eigenvector corresponding to the smallest eigenvalue of the island's covariance matrix.


I then must align the two islands. A smart way would be to use the Fourier-Mellin transform to find the closest transformation between the two islands. However this is complex and slow and didn't work after several attempts including using a 3rd party library, so I use a simpler method: I take the centroid of each island, and find the covariance around each one, then I use the eigenvectors of this covariance to align the two islands, so that the smallest eigenvectors are either parallel or anti-parallel. I test both transformations by looking at the sum of the product of all the heights above water.

It is a bit surprising that the result is such a uniform ellipse, which has 180 degree rotational symmetry. I thought that the ability to rotate would allow more of an egg-like shape with 360 degree rotational symmetry. I think the reason why is that aligning the centres of mass is not the same as finding the cross-correlation peak. 

So instead, I cross correlate the translations by using the 'FFT->multiply by conjugate->IFFT->find peak real part' technique, and I check the value of the peak for both 180 degree rotations, making sure to interpolate the peak using a quadratic interpolation with the two neighbours along each axis. The result is what I expected, the mean island is an egg-like shape:


If I allow reflection symmetry when finding the closest correlation then the result is (surprisingly) unaffected:
This is a bit suspicious. It could be that reflective symmetry is where a full Fourier-Mellin cross-correlation is required, to see the asymmetry in the island, or the asymmetry maybe just be subtle. 

Anyway, here is another run at twice the resolution, just to show that it is repeatable and smooth: