1
rmd_files: [“index.Rmd”, “01-introduction.Rmd”]
2
Introduction
2.1
Who this book is for and how to use it
2.2
Motivations
2.3
A definition of spatial microsimulation
2.4
Learning by doing
2.5
Why spatial microsimulation with R?
2.6
Learning the R language
2.7
Typographic conventions
2.8
An overview of the book
3
SimpleWorld: A worked example of spatial microsimulation
3.1
Getting setup with the RStudio environment
3.1.1
Installing R
3.1.2
RStudio
3.1.3
Projects
3.1.4
Downloading data for the book
3.2
SimpleWorld data
3.3
Generating a weight matrix
3.4
Spatial microdata
3.5
SimpleWorld in context
3.6
Chapter summary
4
What is spatial microsimulation?
4.1
Terminology
4.1.1
Spatial microsimulation as SimCity
4.1.2
Spatial microsimulation: method or approach?
4.2
What spatial microsimulation is not
4.3
Applications
4.3.1
Health applications
4.3.2
Economic policy evaluation
4.3.3
Transport
4.4
Assumptions
4.5
Chapter summary
5
Data preparation
5.1
Updating cross-tabulated census data
5.2
Economic forecasting
5.3
Small area estimation
5.4
Transport modelling
5.5
Dynamic spatial microsimulation
5.6
An input into agent based models
5.7
Accessing the input data
5.8
Target and constraint variables
5.9
Loading input data
5.9.1
Loading and checking aggregate level data
5.10
Subsetting to remove excess information
5.11
Re-categorising individual level variables
5.12
Matching individual and aggregate level data names
5.13
‘Flattening’ the individual level data
5.14
Chapter summary
6
Population synthesis
6.1
Weighting algorithms
6.2
Iterative Proportional Fitting
6.2.1
IPF in theory
6.2.2
IPF in R
6.2.3
IPF with
ipfp
6.3
iteration 0: 0.141421
6.4
iteration 1: 0.00367328
6.5
iteration 2: 9.54727e-05
6.6
…
6.7
iteration 9: 4.96507e-16
6.8
iteration 10: 4.96507e-16
6.8.1
IPF with
mipfp
6.9
Integerisation
6.9.1
Concept of integerisation
6.9.2
Example of integerisation
6.10
Expansion
6.10.1
Weights per individual
6.10.2
Weights per category
6.11
Integerisation and expansion
6.12
Comparing
ipfp
with
mipfp
6.12.1
Comparing the methods
6.12.2
Comparing the weights for SimpleWorld
6.12.3
Comparing the results for SimpleWorld
6.12.4
Speed comparisons
6.13
Chapter summary
7
Alternative approaches to population synthesis
7.1
GREGWT
7.2
Population synthesis as an optimization problem
7.2.1
Reweighting with optim and GenSA
7.2.2
Combinatorial optimisation
7.3
simPop
7.4
The Urban Data Science Toolkit (UDST)
7.5
Chapter summary
8
Spatial microsimulation in the wild
8.1
Selection of constraint variables
8.2
Preparing the input data
8.3
Using the
ipfp
package
8.3.1
Performing IPF on CakeMap data
8.3.2
Integerisation
8.4
Group.1 x
8.5
1 1 1.970570
8.6
2 2 2.027638
8.7
3 3 2.019839
8.8
Using the
mipfp
package
8.8.1
Performing IPF on CakeMap data
8.9
Comparing methods of reweighting large datasets
8.9.1
Comparison of results
8.9.2
Comparison of times
8.10
Chapter summary
9
Model checking and evaluation
9.1
Internal validation
9.1.1
Pearson’s
r
9.1.2
Absolute error measures
9.1.3
Root mean squared error
9.1.4
Chi-squared
9.1.5
Which test to use?
9.1.6
Internal validation of CakeMap
9.2
Empty cells
9.3
External validation
9.4
Chapter summary
10
References
11
Population synthesis without microdata
11.1
Global cross-tables and local marginal distributions
11.2
Two level aggregated data
11.3
Chapter summary
12
Household allocation
12.1
Independent data (individuals and households)
12.1.1
Household type selection
12.1.2
Constituent members selection
12.1.3
End of the household generation process
12.2
Cross data: individual and household level information
12.2.1
Without additional household’s data
12.2.2
With additional household’s data
12.3
Chapter summary
13
The TRESIS approach to spatial microsimulation
13.1
Overview of TRESIS modelling system
13.1.1
Differences between TRESIS and other microsimulation systems
13.2
Synthetic households
13.2.1
What are synthetic households?
13.2.2
Required data for generating synthetic households
13.2.3
Synthetic households in R
13.3
Using demand models to allocate synthetic households to zones using R
13.3.1
Simple discrete choice model for residential location
13.3.2
Results
13.4
Conclusions
13.4.1
Limitations
13.4.2
MetroScan-TI
13.4.3
Extending residential location to transport models in R
13.5
Chapter summary
14
Spatial microsimulation for agent-based models
14.1
Note
14.2
ABM software
14.3
Setting up SimpleWorld in NetLogo
14.3.1
Graphical User Interface in NetLogo
14.4
Allocating attributes to agents
14.4.1
Defining variables
14.4.2
Reading agent data - Option 1
14.4.3
Reading agent data - Option 2
14.5
Running SimpleWorld
14.5.1
More variable definitions
14.5.2
More setup procedures
14.5.3
The main Go procedure
14.5.4
Adding plots to the model
14.5.5
Stopping behavior
14.6
Control the ABM from R
14.6.1
Running a single NetLogo simulation
14.6.2
Running multiple NetLogo simulations
14.7
Chapter summary
14.8
References
15
Appendix: Getting up-to-speed with R
15.1
R understands vector algebra
15.2
R is object orientated
15.3
Subsetting in R
15.4
Further R resources
16
Glossary
17
Bibliography
Facebook
Google+
Twitter
Weibo
Instapaper
A
A
Serif
Sans
White
Sepia
Night
Spatial Microsimulation with R
10
References