CSIS Discussion Paper No. 117

A method of comparing numerical variables defined in a region

Yukio Sadahiro

February 2013
Center for Spatial Information Science, University of Tokyo
5-1-5, Kashiwanoha, Kashiwa-shi, Chiba 277-8568, Japansada@csis.u-tokyo.ac.jp

Keywords: comparison, transformation, numerical variables

Abstract
This paper develops a new method of comparing numerical variables defined ina region. The method covers numerical variables defined over a two-dimensional spacesuch as temperature and humidity distributions and those defined on a discrete spacesuch as the height of trees and the age of buildings. To evaluate the difference between
two variables, the method considers three types of transformations. The transformations
convert one variable so that it fits the other as well as possible. The result gives a basis
for the separate evaluation of spatial and non-spatial differences between the variables.
The transformations also permit us to describe the spatial difference in more detail. To
test the validity of the method, the paper applies it to an analysis of three spatial datasetsof different sizes. The result showed that the proposed method is effective for evaluating
and visualizing the difference between numerical variables.

1. Introduction
This paper proposes a method of comparing numerical variables defined in aregion. Temperature, humidity, and the density of carbon dioxide are represented as
numerical variables defined continuously over a two-dimensional space. Population
counts and population density are also variables defined on a two-dimensional space,though not as smooth as temperature distribution because they are often calculated byaggregating point data in spatial units. Traffic flow is a numerical variable defined on a
network space. The height of trees, the age of buildings, and the annual sales ofsupermarkets are numerical variables defined on a discrete space.
There are several ways of comparing these numerical variables. One method is
to employ general statistical measures. Correlation coefficients, both rank andproduct-moment, tell us whether two variables are correlated with each other. The
Kullback-Leibler divergence (Kullback & Leibler, 1951; Kullback, 1959) is also useful
to compare positive variables. If variables are defined on a discrete space, we can use
the χ2 test to evaluate the difference between the variables from a statistical perspective.
Unfortunately, however, the above statistical measures do not recognize
differences in the spatial dimension (Hubert et al., 1985; Haining, 1991; Lee, 2001).
There are mainly two groups of methods in the literature that incorporate the spatialaspect explicitly.
One group extends the Pearson’s correlation coefficient to consider thecorrelation between variables and their spatial autocorrelation simultaneously. Some of
the methods employ Moran’s I to evaluate the spatial autocorrelation (Wartenberg,
1985; Lee, 2001; Stephane et al., 2008), while the others develop new measures ofspatial autocorrelation (Tjøstheim, 1978; Hubert et al., 1985; Haining, 1991).
Another class of methods uses the earth mover’s distance (Peleg et al., 1989;
Rubner et al., 2000; Zhao et al., 2010). The methods consider the turning of a pile ofdirt into another form with the least cost. It is formulated as a transportation problem,
and the solution is used as a measure of the difference between two variables. Although
the earth mover’s distance is primarily used in image processing, it is also useful inspatial analysis.
The above existing methods are motivated to compare numerical variables
defined on a discrete space. Consequently, they are not directly applicable to theanalysis of numerical variables defined over a continuous space. In addition, the above
methods implicitly assume variables with the same total volume. When the volume isdifferent, they divide each variable by its total volume. Though such a standardization
permits us to focus on the spatial difference between variables, it conceals the-1-non-spatial difference that existed in the original variables. The standardization prevents
us from separating the differences in the spatial dimension and non-spatial dimensions.
There are several papers that discuss the separation of spatial and non-spatial
factors, though their focus is not on the comparison of numerical variables. Pontius(2000, 2002) and Pontius & Millones (2011) propose statistical measures for comparing
categorical variables. Assuming a stochastic process, these measures evaluate the degree
to which the observed number and location of each category differ from the expected
ones. Wong (2011) proposes a new framework that considers the spatial and attributedimensions separately when measuring the spatial autocorrelation. The separation of
spatial and non-spatial factors permits us to deepen our understanding of the structure of
spatial phenomena. Following the line of these papers, this paper aims to evaluate thedifference between numerical variables separately in spatial and non-spatial dimensions.
Section 2 proposes several measures for evaluating the difference between
numerical variables. It also discusses an extension of the measures to treat the difference
between categorical variables. Section 3 applies the proposed approaches to an analysisof three datasets of different sizes in order to demonstrate the effectiveness the method
in exploratory spatial analysis. Section 4 summarizes the conclusions with discussion.
2. Method
This paper discusses the comparison of numerical variables defined over a
two-dimensional continuous space and those defined on a discrete space. We first
discuss the latter and then proceed to the former.
Suppose n regions R={R1, R2, ..., Rn} (N={1, 2, ..., n}) in each of which two
sets of numerical variables U={u1, u2, ..., un} and V={v1, v2, ..., vn} are defined. The
location of Rk is indicated by that of its representative point denoted by zk.
2.1 Separation of the differences between variables
A simple method of comparing two variables is to sum up the difference
between the variables in every region. We call this overall difference given by

DO (U=,V )∑ u −v
i∈N

i

i

.

(1)
Though this measure is easy to calculate and understand, it does not recognize
the spatial difference between variables as general statistical measures. In Figure 1, forinstance, variables U, V11 and V12 have the same configuration of values, which resultsin DO(U, V11)=DO(U, V12). Their spatial distribution, however, is different in that both U

and V12 have a peak in the top row whereas the peak of V11 is at the lower-right corner.
The measure DO do not recognize this difference since it neglects the spatial dimension.
23

919 22 1325 18 1221 18 146

11 15

15 11 614 11 7

16 11 5910

8

13 19 22
V11

3

2

2

1

V13

V12

4

3

V14

22 19 13

7

25 11

3

9

23 24 152

17 4

15 11 61

20 14

14 16 1135 16 19

14

6

5

9

10

4

5

12 26

13 28 17

8

3

1

V22

V23

V24

6 15

31 26 24

10 14 419 11 5

12

7

3

2

U

8

V21

4

16 15 20

1

2

7

21 27

7

5 10

8

6 10

14 12 8

V31

V32

25

4

2 21
V33

2

1

V34

Figure 1. The distributions of U and V.
To resolve the problem, we consider three types of transformations: 1)
rearrangement, 2) moving, and 3) addition/deletion. We apply a transformation to U sothat it fits V as well as possible. This permits us to evaluate the difference between U
and V in the spatial dimension.
1) Rearrangement transformation
Rearrangement transformation changes the location of U values so that its
spatial distribution is similar to that of V as well as possible. To this end, it relocates U
values in the way that the rank of U coincides that of V in every cell. Let r(ui) be thefunction indicating the rank of ui in U. Rearrangement is represented by a binary
function defined by:

1 if r ( ui ) = r ( v j )rij (U ) = 0otherwise.

(2)Rearrangement transformation reduces the difference between U and V to=
DR (U , V )∑∑ ρ (U ) u − viji∈N j∈N

i

j

.
(3)

We call the difference between DO(U, V) and DR(U, V) the location difference:d=
DO (U , V ) − DR (U , V )L (U , V )=∑ u − v − ∑ ρ u − v  .
i∈N



i

i

j∈N

ij

i

j



(4)
Location difference estimates the difference in the location of values of two
variables. If all the elements of U are identical to those of V, the rearrangementtransformation can completely resolve the difference between U and V. In Figure 1, forinstance, we can transform U into V11 or V12 by only changing the location of values. In
such a case, we haved L (U , V ) = DO (U , V ).

(5)
The rearrangement transformation, on the other hand, completely fails in two
circumstances. One is the case whenr=
( ui ) r ( vi ) ∀i ∈ N(6)holds as shown in V13 and V14 in Figure 1. The other is whenui ≤ vi∀i ∈ N ,(7)orui ≥ vi∀i ∈ N(8)

holds as shown in V23 and V24 in Figure 1. In both cases we have

DO (U , V ) = DR (U , V )

.
(9)

and

d L (U , V ) = 0.
(10)2) Moving transformation
The rearrangement transformation changes the location of variables withkeeping their values. This prevents us from transforming U into V13, V14, V21, and V22.
We thus introduce the moving transformation, a special case of earth moving mentioned
earlier. The moving transformation permits us to partially transfer U values between
regions so that the difference between U and V is minimized.
Earth moving, in its original form, assumes two variables with the same total
volume such as the probability density distribution. It converts the distribution of one
variable into that of another variable by transferring values between regions at the least
cost. The transfer can occur between every pair of regions, where the cost is given by
the total weighted volume of transfer. Earth moving makes two distributions completely
identical.
The moving transformation, on the other hand, permits variables with different
total volumes. In addition, it only considers the transfer of a variable between adjacentregions. The moving transformation converts the distribution of one variable into that ofanother variable so that the summation of the difference at each region is minimized at
the least cost. As a result, the moving transformation leaves the difference in the total
volume of variables.
To derive the moving transformation, we have to calculate the volume oftransfer between every adjacent regions. At present, however, we only need the result of
the transformation, which can be obtained without calculating the actual volume oftransfer.
The difference that remains after the moving transformation is given by
DM (U=,V )∑u − ∑v .
i∈N

i

i∈N

i

(11)
The moving transformation can completely convert U into V13, V14, V21 and V22 in Figure
1, each of which has the same total volume as U.
We call the difference between DR(U, V) and DM(U, V) the configurationdifference:d=
DR (U , V ) − DM (U , V )C (U , V )=∑∑ ρ (U ) u − v − ∑ u − ∑ v .
i∈N j∈N

ij

i

j

i∈N

i

i∈N

i

(12)
It is equal to DM(U, V) when the total volume of U is equal to that of V.
The moving transformation does not work when inequality (7) or (8) holds asshown in V23 and V24 in Figure 1. In addition, after the use of the rearrangementtransformation, the moving transformation cannot further reduce the difference between
variables if eitherui ≤ vi ρij (U ) ∀i ∈ N ,(13)
orui ≥ vi ρij (U ) ∀i ∈ N(14)holds. Examples include V31 and V32 in Figure 1. In the above cases, we have

DR (U , V ) = DM (U , V )

.
(15)

and

dC (U , V ) = 0.
(16)

3) The addition/deletion transformation
To remove the difference in the total volume between variables, we finallyemploy the addition/deletion transformation. It changes the value of U into that of V atindividual locations. As a result, U becomes completely identical to V.
The difference reduced by the addition/deletion transformation is called thevolume difference:dV (U , V ) = DM (U , V )=∑u − ∑v .
i∈N

i

i∈N

i

(17)
The relationship among the difference measures is shown in Figure 2. Relative
measures are also useful to compare the location, configuration, and volume differences
between different pairs of variables:d L (U , V ) =d L (U , V )DO (U , V ) ,(18)

d C (U ,V ) =dC (U , V )DO (U , V ) ,

(19)
and

dV (U ,V ) =dV (U , V )DO (U , V ) .

(20)

dL(U, V)

DO(U, V)dC(U, V)DR(U, V)DM(U, V)dV(U, V)

Figure 2. The relationship between the differences.
The three transformations described above permit us to evaluate the differencebetween variables in the spatial and non-spatial dimensions separately. The location andconfiguration differences indicate the spatial difference, while the volume difference
represents the non-spatial one. The relative measures allow us to evaluate the proportionof each component in the overall difference.
The proposed measures can be calculated with or without the standardization ofvariables, depending on the objective of the analysis. If the separation of the spatial andnon-spatial difference is critical, variables should be compared without standardization.
If an emphasis is on the spatial difference, variables should be compared after
standardization. In the latter case, we haveD=d=0
M (U , V )V (U , V ).

(21)
After standardization, inequalities (7) or (8) can hold only when U and V are
identical. This implies that while the moving transformation is almost always effective,
the rearrangement transformation may not work when V=V13 or V=V14 in Figure 1.
2.2 Evaluation of the spatial difference between variables
The difference measures proposed in the previous subsection permit us toconsider the difference between variables in the spatial and non-spatial dimensions
separately. Evaluation is performed basically based on the difference of variables inindividual regions. Consequently, though the transformations on which the difference
measures are defined consider the spatial dimension explicitly, their summary measures
do not reflect the spatial distribution of variables. The difference measures, for instance,
fail to distinguish the difference between U and V11 and that between U and V12 in
Figure 1.
To complement the difference measures, this subsection introduces two
distance measures using the two spatial transformations, that is, the rearrangement andmoving transformations. The distance measures are defined as the weighted average
distance of a particular spatial transformation.
The rearrangement transformation defines a distance measure by∑ ∑ ρ (U ) z − z

λR (U , V ) = i∈N j∈Niji∑∑ z −zn=ii∈N j∈Njj.
n2n∑ ∑ ρij (U ) z i − z ji∈N j∈N∑∑ z −zi∈N j∈Nij(22)
In the moving transformation, we cannot calculate the weighted average
distance as we have not yet derived the actual volume of transfer between regions. We
thus formulate the moving transformation as an optimization problem where the moving
cost is minimized.
Let us assume that U value is transferred from a region only to its adjacentregions. Let NAi be the set of regions adjacent to Ri. The volume of U value transferredfrom Ri to Rj is denoted by xij (xij≥0). We formulate the moving transformation as thefollowing optimization problem where the total volume of transfer is minimized.
Problem MT0 (Moving Transformation):
minimize ∑ ∑ xij
xij ,i , j∈Ni∈N j∈NAi

subject to∑ u − ∑ x + ∑ x − v= ∑ u − ∑ v
i∈N

i

j∈N

ij

j∈N

ji

i

i∈N

i

i∈N

i

xij ≥ 0 i ∈ N, j ∈ NA i
xij = 0 i ∈ N, j ∉ NA i

Problem MT0 is not solvable by using a general optimization technique since it
contains the absolute functions in the constraints. To remove the absolute functions in
the constraints, we define variable wi as
wi = ui − vi − ∑ ( xij − x ji )
j∈N

.
(23)

Substituting Equation (23) into the first constraint of Problem MT0, we obtain=w∑∑ (u − v )
i∈N

i

i

i∈N

i



= ∑  wi + ∑ ( xij − x ji ) 
i∈N 
j∈N

=
∑ wi + ∑∑ ( xij − x ji )i∈N.

i∈N j∈N= ∑ wii∈N(24)
Problem MT0 then becomes
Problem MT:∑∑xminimizeyij ,i , j∈Ni∈N j∈NAi

ij

subject to∑ ( u − v ) ≤ 0 ⇒ w ≤ 0, ∀i ∈ N
i∈N

i

i

i

∑ ( u − v ) ≥ 0 ⇒ w ≥ 0, ∀i ∈ N
i∈N

i

i

i

xij ≥ 0 i ∈ N, j ∈ NA i
xij = 0 i ∈ N, j ∉ NA i

Problem MT is equivalent to Problem MT0 in that both yield the same solution. Problem
MT is a linear optimization problem whose computational complexity is O(n). It is thus
solvable in a linear time.
The solution of Problem MT permits us to calculate the weighted average
distance of moving transformation. Let µA(R) be the average distance between all thepairs of adjacent regions of R. It is given byµA (R ) =∑ ∑ z −zi∈N j∈NAi

2n A

i

j

,

(25)
where nA is the number of pairs of adjacent regions. The distance measure is thendefined as

λM (U , V ) =2∑ ∑ z i − z j xiji∈N j∈NAiµ A ( R ) ∑ ui − vii∈N=4nA ∑ ∑ z i − z j xij.

i∈N j∈NAi∑ ∑ z −z ∑ u −vii∈N j∈NAi

j

i

i∈N

i

(26)
In the moving transformation, it is also useful to calculate the total volume of transfer.
Its standardized form is given byγ M (U ,V ) =∑∑xi∈N j∈NAiij∑ u +∑ v .
i∈N

i

i∈N

i

(27)
2.3 Visualization of the difference between variables
The spatial difference between variables can be visualized effectively by a map
based representation. The rearrangement and moving transformations are visualized byarrows that indicate the degree and direction of transformations as shown in Figure 3.

22 19 13

2

3

6

11 15

13 19 22V11

15 11 6
9

3
U

2

9

7

25 11

1

20 14

10

4
V21

Rearrangement

MovingRearrangement

Moving8

Figure 3. Rearrangement and moving transformations from U to V. The width of arrows
indicates the volume of transfer in the moving transformation.

Visualization of rearrangement transformation, however, does not work when
variables are defined in a large number of regions. In such a case, the map often
contains numerous crossing arrows so that it becomes too complicated to interpret.
Visualization of moving transformation, on the other hand, is relatively free from thisproblem because the arrows are drawn only between adjacent regions. In addition, themoving transformation has a wider variation of map representations such as streamlines,
divergence, and critical points because the moving transformation can be regarded as avector field. This paper recommends the moving transformation as a basis forvisualizing the spatial difference because of its wide applicability and flexibility.
Visualization by the vector field and streamlines may remind of a method for
displaying the migration pattern proposed by Tobler (1987, 1995). These papers,
however, treat the actual movement of people while this paper considers a hypotheticalmovement of a variable as a means of evaluating the difference between variables. We
should note that the vector field and streamlines that visualize the moving
transformation do not indicate the actual movement of a variable in the real world.
2.4 Comparison of continuous variables
This subsection extends the method proposed above to the comparison ofvariables defined over a continuous two-dimensional space. Instead of discrete variables
U and V, we consider two continuous variables f(z) and g(z) defined as functions oflocation z in region R.
The difference measures proposed in Subsection 2.1 are defined based on thesummation of values calculated in individual regions. Consequently, their extension tocontinuous dimension is accomplished by replacing the summations with integrals. The
difference measures DO(U, V) and DM(U, V) become

DO ( f ( z=) , g ( z ))∫z∈Rf ( z ) − g ( z ) dz
(28)

and

DM ( f=( z ) , g ( z ))∫z∈Rf ( z ) dz − ∫z∈Rg ( z ) dz,
(29)

respectively.
Extension of the measure DR(U, V) is as follows. Let r(s, f(z)) be a binary
function defined by1 if f ( z ) =s0 otherwise .

r ( s, f ( z ) ) = (30)
Using the function, we evaluate the area where f(z) and g(z) and are smaller than t, thatis,a ( f ( z )) = ∫∫y∈R s∈0, f ( z ) ρ ( s, f ( y ) ) dsdy
(31)

and
a ( g ( z )) = ∫ρ ( s, g ( y ) ) dsdy∫y∈R s∈0, g ( z ) ,
(32)

respectively. We then define another binary function that indicates the rearrangement of
U at z1 to z2:

1 if a ( f ( z1 ) ) = a ( g ( z 2 ) )h ( z1 , z 2 ) = 0otherwise.

(33)
Equation (33) corresponds to equation (2) in Subsection 2.1. Using this function, we
define DR(f(z), g(z)) as=DR ( f ( z ) , g ( z ) )∫ ∫z1∈R z 2 ∈Rη ( z1 , z 2 ) f ( z ) − g ( z ) dz 2 dz1.

(34)
We can similarly define the other measures of difference. The distance measure
based on the rearranging transformation is given by∫ ∫λR ( f ( z ) , g ( z ) ) = z ∈R z ∈R
1

A
=

A∫

η ( z1 , z 2 ) z1 − z 2 dz 2 dz1

2∫ ∫z1∈R z 2 ∈RA2,η ( z1 , z 2 ) z 1 − z 2 dz 2 dz 1∫
∫ ∫z1∈R z 2 ∈Rz 1 − z 2 d z 2 d z1

z1∈R z 2 ∈Rz 1 − z 2 d z 2 d z1

(35)
where A is the area of R. The distance measure based on the moving transformation
cannot be represented in an analytical form since it is calculated from the solution of anoptimization problem. It is thus represented as a discrete approximation:

λM ( f ( z ) , g ( z ) ) =4nA ∑ ∑ z i − z j xiji∈N j∈NAi∑ ∑ z −z ∫i∈N j∈NAi

i

j

z∈R

f ( z ) − g ( z ) dz .

(36)
2.5 Comparison of categorical variables
The above method is also applicable to the comparison of categorical variables.
Suppose two categorical variables U={u1, u2, ..., un} and V={v1, v2, ..., vn} defined in nregions R={R1, R2, ..., Rn}. Each variable takes one of W categories represented by W
integers W={1, 2, ..., W}.
Let j(i, j) be a measure of distance between different categories i and j. The
simplest definition of j(i, j) is1 if ui ≠ v jj ( ui , v j ) = 
0 otherwise .
(37)
A distance matrix Γ is defined by

ϕϕ 0(1, 2 )  (1,W ) 0ϕϕ( 2,1)( 2,W )

Γ=
 
.




0 
(W ,1) (W , 2 ) 
ϕϕ
(38)
Using the matrix, we define the overall difference between U and V as

DO (U , V ) = ∑ ϕ ( ui , vi )
i∈N

.

(39)
The rearrangement transformation is defined as the transformation that
relocates U values so that they U and V coincide as well as possible. Let xij be a binary
function indicating the rearrangement of U:1 if ui is relocated to R j
xij = otherwise.
0(40)
The rearrangement transformation is then obtained as a solution of an assignment
problem:Problem RT (Rearrangement Transformation):
minimizexij ,i , j∈Nsubject to∑∑ x j ( u , v )i∈N j∈Nij

ijxij ≥ 0, i, j ∈ N
=
=
x ∑
x 1
∑
i∈N

ij

j∈N

ij

Problem RT is a linear assignment problem, where every value of U is assigned to one
of V without overlap (Burkard & Dragoti-Cela, 1999; Burkard et al., 2009). Since its
computational complexity is O(n), it is solvable in a linear time. The rearrangementtransformation reduces the difference between U and V to

DR (U , V ) = ∑ xijj ( ui , vi )
i∈N

.

(41)
The moving transformation is not defined for categorical variables because apartial transfer of a variable is not meaningful. The addition/deletion transformation
defined for numerical variables corresponds to the replacement transformation thatchanges ui into vi in every region. The replacement transformation completely removes
the difference between U and V.
Using the above difference measures, we can evaluate the spatial andnon-spatial difference separately in categorical variables. The location and attributedifferences are defined asd=
DO (U , V ) − DR (U , V )L (U , V )
(42)
and

d A (U , V ) = DR (U , V ) ,(43)
respectively. The former indicates the spatial difference while the latter is thenon-spatial difference.
The distance measure is calculated based on the rearrangement transformation.
It is defined as

λR (U ,V ) =n∑ ∑ xij z i − z ji∈N j∈N∑ ∑ zi − z ji∈N j∈N.

(44)3. Applications
To test the validity of the methods proposed in the previous section, this section
applies it to the analysis of three datasets of different sizes. The computation was doneon a machine with an Intel Core i7-2620M 2.70GHz processor and 8 GB memory
running under Windows 7 Professional. We used a mathematical programming software
NUOPT ver.14 (Mathematical Systems Inc.) for solving Problem MT.
3.1 A small dataset
We first apply the method to the comparison of variables shown in Figure 1. A
primary objective is to understand the properties and behavior of the difference anddistance measures.
We start with examining difference measures. We can completely transform U
into V11 or V12 by only the rearrangement transformation. Consequently, dL(U, V)=1 anddC(U, V)=dV(U, V)=0 as seen in Table 1. The rearrangement transformation, on the other
hand, does not work at all for transforming U into V13, V14, V23, or V24 as indicated bydL(U, V)=0 in Table 1. The moving transformation is more broadly effective than therearrangement transformation. The contrast is very clear in the cases of V13 and V14,
where the rearrangement transformation completely fails while the moving
transformation totally removes the difference between the variables. We can confirm
this by dL(U, V)=0 and dC(U, V)=1 in these cases. The moving transformation is not at
all effective only in the transformation of U into V23 or V24, where dC(U, V)=0. ThoughdC(U, V)=0 holds also for V31 and V32, this does not imply that the moving
transformation is ineffective in these cases. It is because the moving transformation
cannot further reduce the difference between variables after the rearrangementtransformation is applied. In other words, the rearrangement and moving
transformations are equally effective for transforming U into V31 and V32. The
addition/deletion transformation completely removes the difference between variables
in any case. It works even if both the rearrangement and moving transformation are
ineffective such as the cases of V23 and V24.
Table 1 Difference and distance measures calculated for variables shown in Figure 1.

V11

V12

V13

V14

V21

V22

V23

V24

V31

V32

V33

V34

DO(U, V)

98

6

10

8

62

86

90

40

68

85

51

36

DR(U, V)

0

0

10

8

12

12

90

40

30

37

9

36

DM(U, V)

0

0

0

0

0

0

90

40

30

37

9

26

DAD(U, V)

0

0

0

0

0

0

0

0

0

0

0

0

dL(U, V)

1.000

1.000

0.000

0.000

0.806

0.860

0.000

0.000

0.559

0.565

0.824

0.000

dC(U, V)

0.000

0.000

1.000

1.000

0.194

0.140

0.000

0.000

0.000

0.000

0.000

0.278

dV(U, V)

0.000

0.000

0.000

0.000

0.000

0.000

1.000

1.000

0.441

0.435

0.176

0.722

λR(U, V)

1.477

0.153

0.000

0.000

1.125

1.296

0.617

0.774

0.909

1.175

0.927

0.356

λM(U, V)

2.653

1.000

1.200

1.000

1.903

2.698

0.000

0.000

1.529

1.600

1.373

0.389

γM(U, V)

1.300

0.030

0.060

0.040

0.590

1.160

0.000

0.000

0.442

0.834

0.335

0.062

We then turn to the distance measures. Though both V11 and V12 can beobtained from U by only the rearrangement transformation, they are different in thespatial arrangement of values. The peak of U is closer to that of V12 than that of V11.
Transformation from U into V11 requires the relocation of longer distance, andconsequently, λR(U, V11)>λR(U, V12) as seen in Table 1. It also applies to the moving
transformation that is reflected by λM(U, V11) >λM(U, V12).
When the moving transformation is completely ineffective, Problem MT does
not yield a valid solution. The distance measure λM(U, V) inevitably becomes zero as
seen in λM(U, V23) and λM(U, V24). On the other hand, λR(U, V) does not necessarily
become zero when the rearrangement transformation fails. The rearrangementtransformation relocates U values so that their ranks coincide those of V in every cell,even if it does not reduce the differences between variables at all. This results in dL(U,V)=0 and λR(U, V)>0 as seen in the cases of V23 and V24.
3.2 A larger dataset
We then apply the method to the comparison of a larger dataset shown in
Figure 4. Our objective is to examine the validity of the visualization method of moving
transformation. To focus on the spatial difference, we set the variables to have the same
total volume. Variables U, V1, V3, V5, and V6 are unimodal, that is, they all has only asingle peak. Variable V4 has two peaks, which is often called bimodal. Variable V2 has adoughnut-shaped distribution.

U

V1

V2

V3

V4

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

2

2

2

2

2

2

2

1

1

1

1

1

1

1

1

1

1

1

2

4

4

4

4

4

2

1

1

1

2

2

2

2

2

2

1

1

2

4

8

8

8

4

2

1

1

1

2

4

4

4

4

4

1

1

2

4

8 16 8

4

2

1

1

1

2

4

8

8

9

5

1

1

2

4

8

8

8

4

2

1

1

1

2

4

8 16 9

5

1

1

2

4

4

4

4

4

2

1

1

1

2

4

9

9

9

5

1

1

2

2

2

2

2

2

2

1

1

1

2

5

5

5

5

5

V5

V6

Figure 4. A larger dataset. The values of variables are indicated by gray shades.
Figure 5 visualizes the moving transformation by the vector plot. The direction
and length of arrows indicate the direction and volume of moving transformation,
respectively.
Both U and V1 are unimodal whose peak is located at the center of the region.
Since the slope is gentler in the latter, transformation of U into V1 can be regarded as aslight collapse of a unimodal distribution. This is clearly visualized in Figure 5, where
all the arrows are pointing outward from the center.
The moving transformation of U into V2 looks quite similar in Figure 5, though
the distribution of V2 is quite different from that of V1. This implies that thetransformation into V2 lies on an extension of that into V1. It is reflected in longer
arrows and the larger value of the distance measure λM.
Transformation into V3 is the centralization of U from the surrounding to thecenter. Transformation into V4 is a morphological change from a unimodal to a bimodal
distribution. Arrows clearly visualize these transformations. The distance measure islarger in the latter case because the change is more substantial. Transformations into V5
and V6 are both the shift of a peak. Since the peak moves further in V6, arrows are longer
and the distance measure is larger.
The moving transformation helps us to grasp intuitively the spatial difference
between variables. Besides the vector plot, streamlines are also effective as seen later inthe following subsection.

V1 (λM=2.443)

V2 (λM=4.551)

V3 (λM=2.156)

V4 (λM=4.621)

V5 (λM=4.931)

V6 (λM=6.659)

Figure 5. Visualization of moving transformation that changes U into V in Figure 4. The
direction and length of arrows indicate the direction and volume of moving
transformation, respectively.
3.3 A real dataset
We finally apply the proposed method to the analysis of a real dataset to test its
practical feasibility. We analyzed the change of population distribution from 1970 to2005 in Chiba Prefecture, Japan. Figure 6 shows the population distribution in 2005 andthe railway network in Chiba. The data is obtained as a 1km resolution raster datasetthat consists of 80*150 cells. Since Chiba is adjacent in the east of Tokyo Metropolis,
its population density is higher in the northwestern area that is densely inhabited bypeople working in Tokyo.
N

0

20

40km

Ibaraki
Saitama

Tokyo

Tokyo Bay
Pacific Ocean

490.000147.00074.00045.000-

Kanagawa

28.00016.0007.0001.0000.000-

Figure 6. Population distribution in Chiba prefecture, Japan in 2005. Chiba is adjacentto Tokyo, Saitama, and Ibaraki prefectures. White lines indicate railway lines.
Figure 7 shows the change of population distribution from 1970 to 2005. To
compare the spatial structure of the distributions between different years, westandardized them so that their summation is all equal. Population density is higher in
the northwestern area all through the period. Population constantly decreases in thesouth area, while its change is not so clear in other areas.

1970

1985

2000

1975

1990

2005

1980

1995

Figure 7. The change of population distribution in Chiba from 1970 to 2005. The figures
are comparable with each other since they show the relative distribution of population ineach year.
We analyzed the change of population distribution by comparing the
distributions in every five-year period. The result is shown in Figure 8 and Table 2. The
former visualizes the moving transformation while the latter summarizes the difference
and distance measures. Since the moving transformation is very similar in the 70-75,

75-80, 80-85, and 85-90 periods, we present only that of ‘70-75’ (Figure 8).

(a) 70-75(b) 90-95(c) 95-00(d) 00-05

Figure 8. Vector plots and streamlines representing the change in population distribution
in five-year periods.

Table 2 Difference and distance measures of five-year periods.
70-75

75-80

80-85

85-90

90-95

95-00

00-05

DO(U, V)

0.298

0.297

0.186

0.129

0.097

0.070

0.089

DR(U, V)

0.082

0.098

0.055

0.044

0.031

0.014

0.018

DM(U, V)

0.000

0.000

0.000

0.000

0.000

0.000

0.000

DAD(U, V)

0.000

0.000

0.000

0.000

0.000

0.000

0.000

dL(U, V)

0.723

0.672

0.705

0.659

0.679

0.797

0.799

dC(U, V)

0.277

0.328

0.295

0.341

0.321

0.203

0.201

dV(U, V)

0.000

0.000

0.000

0.000

0.000

0.000

0.000

λR(U, V)

0.441

0.329

0.293

0.301

0.268

0.247

0.300

λM(U, V)

0.438

0.394

0.352

0.247

0.247

0.230

0.243

γM(U, V)

1.258

0.722

0.648

0.581

0.599

0.402

0.516

The Tokyo suburban area rapidly expanded from the 1960s to 1980s. During
this period, population increased primarily in two areas in Chiba. One is thenorthwestern area that is adjacent to Tokyo Metropolis. Arrows are facing west in thisarea as seen in Figure 8a. The other is the northern end where a railway line is running
directly connected to Tokyo. In this area arrows are facing to the railway line runningalong the northern boundary of Chiba.
The expansion of Tokyo began to slow down from 1991 when an economic
bubble collapsed. In parallel with this, new towns have been built in the north-central
area of Chiba, especially from 1990 to 1995. Population increased in this area more
rapidly than in the other areas, and consequently, arrows in this area were turned aroundto the south as seen in Figure 8b.
The new towns, however, could not attract people as expected. Moreover, thecollapse of economic bubble caused a drastic drop in land prices in Tokyo. As a result,people returned to the central area of Tokyo and its close suburbs. Figure 8c visualizes
the transitional phase where the vector field looks complicated in the center of Chiba.
Figure 8d, on the other hand, clearly indicates that people returned to Tokyo from 2000
to 2005.

Let us then look at Table 2 in comparison with Figure 8. Population distribution
drastically changed in the 70-75 period as indicated by long arrows in Figure 8a. This isreflected as large values of the difference and distance measures during this period in
Table 2. Conversely, the measures show the smallest values in the 95-00 period when
the change in population distribution is not significant as seen in Figure 8c.
5. Conclusion
This paper proposed a new method of comparing numerical variables definedin a region. The method introduced three types of transformations called therearrangement, moving, and addition/deletion transformations. The transformations
convert one variable so that it fits the other as well as possible. The result provides abasis for evaluating the differences between variables in terms of spatial and non-spatial
dimensions separately. The distance measures permit us to investigate the spatialdifference between variables in more detail. To test the validity of the method, the paper
applied it to an analysis of three spatial datasets of different sizes. The result indicatedthat the method is effective for evaluating and visualizing the difference between
variables.
We finally discuss some limitations and extensions of the paper for future
research.
First, we should extend the method to compare variables defined on different
spaces. For comparing continuous variables, numerous methods have been proposed inimage analysis and mathematical morphology (Serra, 1984, 1988; Goutsias & Heijmans,
2000; Shih, 2009l; Soille, 2010). Concerning discrete variables, statistical tests areavailable such as the t-test and the Wilcoxon-Mann-Whitney test. However, thesemethods do not explicitly consider the spatial and non-spatial differences separately.
Extension to this direction should be further examined.
Second, this paper considers three aspects of the difference between variables:
location, configuration, and volume. The difference, however, can also be evaluatedfrom other perspectives. Spatial analysis, for instance, often focuses on the topologicalstructure of the distribution of numerical variables (Warntz, 1966; Warntz & Waters,
1975; Okabe & Masuda, 1984). Difference in arrangement of local maxima and minima
has also drawn the attention of geographers. The difference between variables should be
discussed from a wider variety of perspectives.
Third, comparison of more than two variables is also an important topic.
Though we can analyze multiple variables simultaneously by applying our method toevery pair of variables, it is time consuming and the integration of the obtained results isnot straightforward. Wartenberg (1985) develops a measure of multivariate spatial
correlation by borrowing the scheme of principal factor components analysis. We
should extend our method along with this line.

References
Burkard, R. & Dragoti-Cela, E. (1999). Linear assignment problems and extensions. In
P. M. Pardalos, D.-Z. Du, & R. L. Graham (Eds.), Handbook of Combinatorial
Optimization, Supplement Volume A (pp. 75-149). Berlin: Springer.
Burkard, R., Dell’Amico, M., & Martello, S. (2009). Assignment Problems.
Philadelphia: Society for Industrial and Applied Mathematics.
Cohen, J. (1960). A coefficient of agreement for nominal scales. Educational andPsychological Measurement, 20, 37-46.
Goutsias, J. & Heijmans, H. J. A. M. (2000). Mathematical morphology. Fairfax, VA:
IOS Press.
Haining, R. (1991). Bivariate correlation with spatial data. Geographical Analysis, 23,
210-227.
Hubert, L. J., Golledge, R. G., Constanzo, C. M., & Gale, N. (1985). Measuringassociation between spatially defined variables: an alternative procedure.
Geographical Analysis, 17, 36-46.
Kullback, S. & Leibler, R. A. (1951). On information and sufficiency. Annals of
Mathematical Statistics, 22, 79-86.
Kullback, S. (1959). Information theory and statistics. New York: Wiley.
Lee, S-I. (2001). Developing a bivariate spatial association measure: an integration ofPearson’s r and Moran’s I. Journal of Geographical Systems, 3, 369-385.
Okabe, A. & Masuda, S. (1984). Qualitative analysis of two-dimensional urban
population distributions in Japan. Geographical Analysis, 16, 301-312.
Peleg, S., Werman, M., & Rom, H. (1989). A unified approach to the change ofresolution: space and gray-level. IEEE Transactions on Pattern Analysis andMachine Intelligence, 11, 739-742.
Pontius, R. G. Jr. (2000). Quantification error versus location error in comparison of
categorical maps. Photogrammetric Engineering & Remote Sensing, 66,
1011-1016.
Pontius, R. G. Jr. (2002). Statistical methods to partition effects of quantity and location
during comparison of categorical maps at multiple resolutions. PhotogrammetricEngineering & Remote Sensing, 68, 1041-1049.
Pontius, R. G. Jr. & Millones, M. (2011). Death to Kappa: birth of quantity
disagreement and allocation disagreement for accuracy assessment. International
Journal of Remote Sensing, 32, 4407-4429.
Rubner, Y., Tomasi, C., & Guibas, L. J. (2000). The earth mover’s distance as a metricfor image retrieval. International Journal of Computer Vision, 40, 99-121.

Serra, J. (1984). Image processing and mathematical morphology, Volume 1. New York:
Academic Press.
Serra, J. (1988). Image processing and mathematical morphology, Volume 2:
Theoretical Advances. New York: Academic Press.
Shih, F. Y. (2009). Image processing and mathematical morphology: Fundamentals andapplications. Boca Raton: CRC Press.
Soille, P. (2010). Morphological image analysis: principles and applications. Berlin:
Springer.
Stephane, D., Sonia, S., & Francois, D. (2008). Spatial ordination of vegetation datausing a generalization of Wartenberg’s multivariate spatial correlation. Journal of
Vegetation Science, 19, 45-56.
Tjøstheim, D. (1978). A measure of association for spatial variables. Biometrika, 65,
109-114.
Tobler, W. (1987). An experiment in migration mapping by computers. The American
Cartographer, 14, 155-163.
Tobler, W. (1995). Migration: Ravenstein, Thorntwaite, and beyond. Urban Geography,
16, 327-343.
Warntz, W. (1966). The topology of a socioeconomic terrain and spatial flows. Papers
in Regional Science, 17, 47-61.
Warntz, W. & Waters, N. (1975). Network representations of critical elements ofpressure surface. Geographical Review, 65, 476-492.
Wartenberg, D. (1985). Multivariate spatial correlation: a method for exploratory
geographical analysis. Geographical Analysis, 17, 263-283.
Wong, D. W. (2011). Exploring spatial patterns using an expanded spatial
autocorrelation framework. Geographical Analysis, 43, 327-338.
Zhao, Q., Yang, Z., & Tao, H. (2010). Differential earth mover’s distance with its
applications to visual tracking. IEEE Transactions on Pattern Analysis andMachine Intelligence, 32, 274-287.