City Growth

selections

function to fit
datasets
options and actions
generate Excel tables

results

selections

simulation type
final population
maximum cities
alpha
total fertility rate
initial distribution

results

About this Website
This website accompanies the City Growth research report and arXiv manuscript to allow the reader to visualize and explore all of the datasets and simulation options discussed there.
Curve Fitting
In the City Data Fitting tab, you may fit datasets of city sizes (up to tens of thousands of cities) to any of four functions. Datasets are available from the four menus, or you can paste any comma- or return-delimited list of integers into the yellow "Paste data here" box and click "Go". Fitting is by least-squares fitting in untransformed data space using the Nelder-Mean simplex method, based on the program "amoeba" in William Press et al, Numerical Recipes in Pascal. Standard deviations of fitted parameters are estimated by the curvature at the error minimum. Datasets in the Test Data menu are generated from the selected function, as tests of the fitting method to recover the input parameters.
Simulation
Two implementations of the 'Bagrow model' are offered. In each iteration of the simple checkboard growth model, a single checker (person) is placed on a square (city) by the following rules:
  1. With probability r = 1/(α - 1), a checker is placed on a square that already has other checkers, with probability proportionate the the number of checkers already there. This is the rich-get-richer positive feedback mechanism essential to the generation of a power law distribution.
  2. With probability 1 - r, a checker is placed on any square, occupied or not, chosen at random.
  3. The size of the checkerboard (number of squares) is a user option; if left blank it is unlimited, thus step 2 always places the checker on a new square.
In the 'haplotree' growth model, a parent-child family tree is constructed:
  1. The tree begins with a single parent in a single city.
  2. In each generation, all parents have a random Poisson number of children, chosen as a random value from a Poisson distribution with user-entered mean λ = TFR/2.
  3. With probability r = 1/(α - 1), each child is assigned the same city as their parent.
  4. With probability 1 - r, each child is assigned to a city chosen at random.
  5. The size of the checkboard is as above.
In all cases the displayed fitted function is that selected under the first tab.
Download Source Code and Datasets
All source code is in Javascript and runs client-side, thus it is all accessible in any browser (though you may need to select "development mode" for your browser). The most relevant subset is available below.

Author
All code and content is by Rob Spencer. You may contact me here or see my résumé.