Discrete Density Milestone
We think of a density function as being a formula rho(x,y).
However, in real life applications, instead of a formula for rho(),
we may only have density measurements at specify points, or
we may have divided a polygon into subregions, and know a
constant density value for each subregion.
Think about
how the population density is defined over a state like Florida.
It certainly varies from point to point, but we really don't
have a formula for it, just values over large census blocks.
How could we find the population "center of mass" of Florida?
How could we do a Voronoi diagram of Florida, using a point in
each of the current congressional districts as the generators?
How could we do a CVT iteration for Florida which factored
in the population density?
Topics:
-
Keeping things simple, we will start by setting up a rectangujlar
"state", and we will give it a set of 25 square counties, arranged in
a 5x5 array. Each county will have a given population. We will
convert the population arrays into probability arrays, then into
a cumulative density function (CDF) array. Then we will see how
this CDF array can be used so that a random number R between
0 and 1 can select a county uniformly with respect to population.
-
Once we have selected a county, we need to select a person in
the county. We will take this to mean that we need to select
a point uniformly at random within the square that is the county.
To do this requires some tedious and error prone calculation
to turn a linear index into a row and column index, into a
lower left (X,Y) corner and upper right (X,Y) corner and
then into a random location.
-
Now we can see how to sample 1,000 people at random from
our state. We can make a plot of the locations of these
people, and see if it corresponds to the original discrete
density table we were given.
Last revised on 09 November 2016.