Welcome
Reference
1
Introduction
1.1
Who this book is for and how to use it
1.2
Motivations
1.3
A definition of spatial microsimulation
1.4
Learning by doing
1.5
Why spatial microsimulation with R?
1.6
Learning the R language
1.7
Typographic conventions
1.8
An overview of the book
2
SimpleWorld: A worked example of spatial microsimulation
2.1
Getting setup with the RStudio environment
2.1.1
Installing R
2.1.2
RStudio
2.1.3
Projects
2.1.4
Downloading data for the book
2.2
SimpleWorld data
2.3
Generating a weight matrix
2.4
Spatial microdata
2.5
SimpleWorld in context
2.6
Chapter summary
3
What is spatial microsimulation?
3.1
Terminology
3.1.1
Spatial microsimulation as SimCity
3.1.2
Spatial microsimulation: method or approach?
3.2
What spatial microsimulation is not
3.3
Applications
3.3.1
Health applications
3.3.2
Economic policy evaluation
3.3.3
Transport
3.4
Assumptions
3.5
Chapter summary
4
Data preparation
4.1
Accessing the input data
4.2
Target and constraint variables
4.3
Loading input data
4.4
Subsetting to remove excess information
4.5
Re-categorising individual level variables
4.6
Matching individual and aggregate level data names
4.7
‘Flattening’ the individual level data
4.8
Chapter summary
5
Population synthesis
5.1
Weighting algorithms
5.2
Iterative Proportional Fitting
5.2.1
IPF in theory
5.2.2
IPF in R
5.2.3
IPF with
ipfp
5.2.4
IPF with
mipfp
5.3
Integerisation
5.3.1
Concept of integerisation
5.3.2
Example of integerisation
5.4
Expansion
5.4.1
Weights per individual
5.4.2
Weights per category
5.5
Integerisation and expansion
5.6
Comparing
ipfp
with
mipfp
5.6.1
Comparing the methods
5.6.2
Comparing the weights for SimpleWorld
5.6.3
Comparing the results for SimpleWorld
5.6.4
Speed comparisons
5.7
Chapter summary
6
Alternative approaches to population synthesis
6.1
GREGWT
6.2
Population synthesis as an optimization problem
6.2.1
Reweighting with optim and GenSA
6.2.2
Combinatorial optimisation
6.3
simPop
6.4
The Urban Data Science Toolkit (UDST)
6.5
Chapter summary
7
Spatial microsimulation in the wild
7.1
Selection of constraint variables
7.2
Preparing the input data
7.3
Using the
ipfp
package
7.3.1
Performing IPF on CakeMap data
7.3.2
Integerisation
7.4
Using the
mipfp
package
7.4.1
Performing IPF on CakeMap data
7.5
Comparing methods of reweighting large datasets
7.5.1
Comparison of results
7.5.2
Comparison of times
7.6
Chapter summary
8
Model checking and evaluation
8.1
Internal validation
8.1.1
Pearson’s
r
8.1.2
Absolute error measures
8.1.3
Root mean squared error
8.1.4
Chi-squared
8.1.5
Which test to use?
8.1.6
Internal validation of CakeMap
8.2
Empty cells
8.3
External validation
8.4
Chapter summary
9
Population synthesis without microdata
9.1
Global cross-tables and local marginal distributions
9.2
Two level aggregated data
9.3
Chapter summary
10
Household allocation
10.1
Independent data (individuals and households)
10.1.1
Household type selection
10.1.2
Constituent members selection
10.1.3
End of the household generation process
10.2
Cross data: individual and household level information
10.2.1
Without additional household’s data
10.2.2
With additional household’s data
10.3
Chapter summary
11
The TRESIS approach to spatial microsimulation
11.1
Overview of TRESIS modelling system
11.1.1
Differences between TRESIS and other microsimulation systems
11.2
Synthetic households
11.2.1
What are synthetic households?
11.2.2
Required data for generating synthetic households
11.2.3
Synthetic households in R
11.3
Using demand models to allocate synthetic households to zones using R
11.3.1
Simple discrete choice model for residential location
11.3.2
Results
11.4
Conclusions
11.4.1
Limitations
11.4.2
MetroScan-TI
11.4.3
Extending residential location to transport models in R
11.5
Chapter summary
12
Spatial microsimulation for agent-based models
12.1
Note
12.2
ABM software
12.3
Setting up SimpleWorld in NetLogo
12.3.1
Graphical User Interface in NetLogo
12.4
Allocating attributes to agents
12.4.1
Defining variables
12.4.2
Reading agent data - Option 1
12.4.3
Reading agent data - Option 2
12.5
Running SimpleWorld
12.5.1
More variable definitions
12.5.2
More setup procedures
12.5.3
The main Go procedure
12.5.4
Adding plots to the model
12.5.5
Stopping behavior
12.6
Control the ABM from R
12.6.1
Running a single NetLogo simulation
12.6.2
Running multiple NetLogo simulations
12.7
Chapter summary
13
Appendix: Getting up-to-speed with R
13.1
R understands vector algebra
13.2
R is object orientated
13.3
Subsetting in R
13.4
Further R resources
14
Glossary
15
Bibliography
16
Spatial Microsimulation with R
Spatial Microsimulation with R
15
Bibliography