SlideShare a Scribd company logo
Introduction to Computing
for Complex Systems
(Lab Session 4)
daniel martin katz
illinois institute of technology
chicago kent college of law
@computationaldanielmartinkatz.com computationallegalstudies.com
Take a Look at
this Article
from the
Economist
(July 22, 2010)
Agent Based
Models and
Positive
Economic
Theory
Refer Back to
my slides about
equilibrium and
its discontents
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
Schelling Social Segregation Model
the full
model
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
Print This and Draw the
Connections for a Full Map
of the Schelling Code
Mapping of the
Schelling Code
(%-similar-wanted is a slider)
We Need to see
What “update-
varables” is
Actually Doing
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
Here we are going to “set” some of our
“turtles-own” variables
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
“Set” the Turtles-own Variable “similar-nearby”
to the count of “turtles-on” neighbors (8 of them)
but only those with color = my color
“Set” the Turtles-own Variable “other-nearby”
to the count of “turtles-on” neighbors (8 of them)
but only those with color = not my color
Take a look at what is happening here
The “happy?” condition is going to be important
involves an agent by agent comparison of the
spread between “similarity-wanted” & “similar-
nearby”
Now Lets Look at “Update-globals”
It involves “lets” and “sets”
uses the globals but also some of the
turtles-own variables
I will allow you to review this on your own
However, consider the syntax of “sum”
(1) Right Click
(ctrl + Click on Mac)
on the “percent-
similar” plot
(2) This will appear
and will allow for
various modifications
(color, interval, etc.)
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
We now consider the “to go”
portion of the code
lets reduce the “to go” procedures
the “to go” portion
of the code
above are the major new elements
remember conceptually the model relies
upon movement if a turtle is unhappy
Again, we have the “if”
the “to go” portion
of the code
The “to go” button with
stop when all turtles
are “happy?”
Here is how “Happy?” gets set:
model continues to tick until every agent is
above the “%-similar-wanted” as set on the
slider
create an agentset of “not happy?” turtles
the movement portion
of the code
For that agentset we run the “find-new-spot”
procedures
We know from the “to go” procedures that
this is going to continue to run until the
“if” condition is satisfied
the movement portion
of the code
the movement portion
of the code
the movement portion
of the code
Notice that it is going to re-run the “find-new-spot”
If the “if” condition is met
In other words, agents are going to move until
they find a open patch
then agent will occupy the center of open patch
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
Thinking about Extensions
to the Schelling Model
This is closer to a “representative agent” model
Agents are homogenous in their %similar-wanted
In reality, there is likely variance across agents
In other words, comparing across agents there
are differential preferences with respect to the
%similar-wanted
Thinking about Extensions
to the Schelling Model
spatial considerations
The 8 neighbors might not be how
individuals actually make their assessments
agents might make choices based upon a wider
assessment of the neighborhood
there might be different “prices” for different
patches (i.e. a simulated housing market)
Thinking about Extensions
to the Schelling Model
structural considerations
the model could encode certain barriers
to entry to particular neighborhoods
barriers could be highly asymmetric
(i.e. red turtles face no barriers and
green turtles face high barriers)
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
An Exercise
Start With the Default
Implementation of
Social Segregation
Imagine that you are
interested in
developing a certain
style of integration
Modify the Code as
Needed in Order to
Produce The Closest
Possible Model Run
to the Camouflage
Note: this involves 4
Groups not 2 Groups
Your Goal!
Homework Exercise
Send Me Your Best
Effort
daniel.martin.katz@gmail.com
I will announce the
Winner
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
Simple Birth Rates
Simple Birth Rates
Simple Birth Rates
Simple Birth Rates
take a few minutes and play around with the model
consider the questions offered above
Thinking Conceptually:
Simple Birth Rates
What Does the Turtle Movement Add to the Model?
Are Turtles Added to the Model?
and If So How?
Are Turtles Removed from the Model?
and If So How?
Simple Birth Rates:
Exploring the Code
Step 1: map the dependancies
Step 2: learn the syntax and
functionality for all
unknown primitives
Step 3: read each line of code and
determine what it doing
Simple Birth Rates
Step 4: sketch a procedures map
that follows the chronology
of your program
At this point it is more Important for you to go
though the models line by line on your own using
the above protocol
Simple
Birth
Rates
Experiment
Basic Setup
Simple Birth Rates
Death
Plots
Reproduction
Movement
Simple Birth Rates
“To Setup” Procedures
Simple
Birth
Rates
“To Go”
Procedures
Simple Birth Rates
Turtle Movement
Procedures
Simple Birth Rates
Please
Review
“ifelse”
How does
it work?
Simple Birth Rates
Take a Look
at the
Reproduction
Procedures
Simple Birth Rates
Death
Procedures
Plot
Procedures
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz
Simple Birth Rates
Right Click (ctrl + Click on Mac) on the “run experiment” Button
Simple Birth Rates
forever
button
Notice
observer is
selected
Calls upon the
go-experiment
sub-procedures
Name of
our
Button
Simple Birth Rates
Take a look at
this for later in
the week
Automation is really
going to help us

More Related Content

PDF
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 6 - Profe...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Profe...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 1 - Profe...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 2 - Profe...
PDF
Complex Systems Computing - Webscraping - Bonus Module
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lecture 4 - Professor...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Bonus Content - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 6 - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 3 - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 1 - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 2 - Profe...
Complex Systems Computing - Webscraping - Bonus Module
ICPSR - Complex Systems Models in the Social Sciences - Lecture 4 - Professor...
ICPSR - Complex Systems Models in the Social Sciences - Bonus Content - Profe...

Viewers also liked (19)

PDF
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 5 - Profe...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lecture 8 and 9 - Pro...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...
PDF
ICPSR - Complex Systems Models in the Social Sciences - 2013 - Professor Dani...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lecture 6 - Professor...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lecture 7 - Professor...
PDF
ICPSR - Complex Systems Models in the Social Sciences - Lecture 6 - Professor...
PDF
What is Computational Legal Studies? Presentation @ University of Houston - ...
ODT
Empresa de jehimi salva
PPTX
Using legal challenges, Kirstie Douse
DOCX
Encuesta informatica
PDF
Presentation @ 24th International Conference on Legal Knowledge and Informati...
PDF
Sinks Method Paper Presentation @ Duke Political Networks Conference 2010
PPTX
Tobacco control in china progress barriers and challenges
PDF
Go Forth And Code
PDF
Technology, Data and Computation Session @ The World Bank - Law, Justice, and...
PDF
Legal Analytics, Machine Learning and Some Comments on the Status of Innovat...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 5 - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lecture 8 and 9 - Pro...
ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...
ICPSR - Complex Systems Models in the Social Sciences - 2013 - Professor Dani...
ICPSR - Complex Systems Models in the Social Sciences - Lecture 6 - Professor...
ICPSR - Complex Systems Models in the Social Sciences - Lecture 7 - Professor...
ICPSR - Complex Systems Models in the Social Sciences - Lecture 6 - Professor...
What is Computational Legal Studies? Presentation @ University of Houston - ...
Empresa de jehimi salva
Using legal challenges, Kirstie Douse
Encuesta informatica
Presentation @ 24th International Conference on Legal Knowledge and Informati...
Sinks Method Paper Presentation @ Duke Political Networks Conference 2010
Tobacco control in china progress barriers and challenges
Go Forth And Code
Technology, Data and Computation Session @ The World Bank - Law, Justice, and...
Legal Analytics, Machine Learning and Some Comments on the Status of Innovat...
Ad

Similar to ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz (20)

PPTX
Software fundamentals
PDF
Chapter 3 introduction to algorithms handouts (with notes)
PPT
Systems Thinking
PPT
Systemsthinking 12632353422762 Phpapp01
PDF
Embracing Complexity for Better Teamwork
PDF
Basics of Programming - A Review Guide
PDF
KScope14 Understanding the Zombies that lurk within your system
PDF
Simple Essay Example Amat
PPT
Improvement 7 tools
PDF
Auto Layout Priorities - CocoaConf 2016 Seattle
PDF
Vpet sd-1.25.18
PDF
How to understand and implement regression analysis
PDF
The gordian knot
PPTX
End-to-End Machine Learning Project
PDF
College Essay Tell Us Something Yourself
PPTX
Are Automated Debugging Techniques Actually Helping Programmers
DOCX
Estimating Models Using Dummy VariablesYou have had plenty of op.docx
PDF
Essay For Gce O Level
PPTX
PATTERNS05 - Guidelines for Choosing a Design Pattern
PPTX
Automating With Excel An Object Oriented Approach
Software fundamentals
Chapter 3 introduction to algorithms handouts (with notes)
Systems Thinking
Systemsthinking 12632353422762 Phpapp01
Embracing Complexity for Better Teamwork
Basics of Programming - A Review Guide
KScope14 Understanding the Zombies that lurk within your system
Simple Essay Example Amat
Improvement 7 tools
Auto Layout Priorities - CocoaConf 2016 Seattle
Vpet sd-1.25.18
How to understand and implement regression analysis
The gordian knot
End-to-End Machine Learning Project
College Essay Tell Us Something Yourself
Are Automated Debugging Techniques Actually Helping Programmers
Estimating Models Using Dummy VariablesYou have had plenty of op.docx
Essay For Gce O Level
PATTERNS05 - Guidelines for Choosing a Design Pattern
Automating With Excel An Object Oriented Approach
Ad

More from Daniel Katz (20)

PDF
Legal Analytics versus Empirical Legal Studies - or - Causal Inference vs Pre...
PDF
Can Law Librarians Help Law Become More Data Driven ? An Open Question in Ne...
DOCX
Why We Are Open Sourcing ContraxSuite and Some Thoughts About Legal Tech and ...
PDF
Fin (Legal) Tech – Law’s Future from Finance’s Past (Some Thoughts About the ...
PDF
Exploring the Physical Properties of Regulatory Ecosystems - Professors Danie...
PDF
Law + Complexity & Prediction: Toward a Characterization of Legal Systems as ...
PDF
Building Your Personal (Legal) Brand - Some Thoughts for Law Students and Oth...
PDF
Measure Twice, Cut Once - Solving the Legal Profession Biggest Challenges Tog...
PDF
Artificial Intelligence and Law - 
A Primer
PDF
Machine Learning as a Service: #MLaaS, Open Source and the Future of (Legal) ...
PDF
LexPredict - Empowering the Future of Legal Decision Making
PDF
{Law, Tech, Design, Delivery} Observations Regarding Innovation in the Legal ...
PDF
Legal Analytics Course - Class 11 - Network Analysis and Law - Professors Dan...
PDF
Legal Analytics Course - Class 12 - Data Preprocessing using dPlyR - Professo...
PDF
Legal Analytics Course - Class 10 - Information Visualization + DataViz in R ...
PDF
Legal Analytics Course - Class #4 - Github and RMarkdown Tutorial - Professor...
PDF
Legal Analytics Course - Class 9 - Clustering Algorithms (K-Means & Hierarch...
PDF
Legal Analytics Course - Class 8 - Introduction to Random Forests and Ensembl...
PDF
Legal Analytics Course - Class 7 - Binary Classification with Decision Tree L...
PDF
Legal Analytics Course - Class 6 - Overfitting, Underfitting, & Cross-Validat...
Legal Analytics versus Empirical Legal Studies - or - Causal Inference vs Pre...
Can Law Librarians Help Law Become More Data Driven ? An Open Question in Ne...
Why We Are Open Sourcing ContraxSuite and Some Thoughts About Legal Tech and ...
Fin (Legal) Tech – Law’s Future from Finance’s Past (Some Thoughts About the ...
Exploring the Physical Properties of Regulatory Ecosystems - Professors Danie...
Law + Complexity & Prediction: Toward a Characterization of Legal Systems as ...
Building Your Personal (Legal) Brand - Some Thoughts for Law Students and Oth...
Measure Twice, Cut Once - Solving the Legal Profession Biggest Challenges Tog...
Artificial Intelligence and Law - 
A Primer
Machine Learning as a Service: #MLaaS, Open Source and the Future of (Legal) ...
LexPredict - Empowering the Future of Legal Decision Making
{Law, Tech, Design, Delivery} Observations Regarding Innovation in the Legal ...
Legal Analytics Course - Class 11 - Network Analysis and Law - Professors Dan...
Legal Analytics Course - Class 12 - Data Preprocessing using dPlyR - Professo...
Legal Analytics Course - Class 10 - Information Visualization + DataViz in R ...
Legal Analytics Course - Class #4 - Github and RMarkdown Tutorial - Professor...
Legal Analytics Course - Class 9 - Clustering Algorithms (K-Means & Hierarch...
Legal Analytics Course - Class 8 - Introduction to Random Forests and Ensembl...
Legal Analytics Course - Class 7 - Binary Classification with Decision Tree L...
Legal Analytics Course - Class 6 - Overfitting, Underfitting, & Cross-Validat...

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Monthly Chronicles - July 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25 Week I
20250228 LYD VKU AI Blended-Learning.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
“AI and Expert System Decision Support & Business Intelligence Systems”
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 3 Spatial Domain Image Processing.pdf

ICPSR - Complex Systems Models in the Social Sciences - Lab Session 4 - Professor Daniel Martin Katz

  • 1. Introduction to Computing for Complex Systems (Lab Session 4) daniel martin katz illinois institute of technology chicago kent college of law @computationaldanielmartinkatz.com computationallegalstudies.com
  • 2. Take a Look at this Article from the Economist (July 22, 2010) Agent Based Models and Positive Economic Theory Refer Back to my slides about equilibrium and its discontents
  • 7. Print This and Draw the Connections for a Full Map of the Schelling Code
  • 8. Mapping of the Schelling Code (%-similar-wanted is a slider)
  • 9. We Need to see What “update- varables” is Actually Doing
  • 12. Here we are going to “set” some of our “turtles-own” variables
  • 14. “Set” the Turtles-own Variable “similar-nearby” to the count of “turtles-on” neighbors (8 of them) but only those with color = my color
  • 15. “Set” the Turtles-own Variable “other-nearby” to the count of “turtles-on” neighbors (8 of them) but only those with color = not my color
  • 16. Take a look at what is happening here The “happy?” condition is going to be important involves an agent by agent comparison of the spread between “similarity-wanted” & “similar- nearby”
  • 17. Now Lets Look at “Update-globals” It involves “lets” and “sets” uses the globals but also some of the turtles-own variables
  • 18. I will allow you to review this on your own However, consider the syntax of “sum”
  • 19. (1) Right Click (ctrl + Click on Mac) on the “percent- similar” plot (2) This will appear and will allow for various modifications (color, interval, etc.)
  • 24. We now consider the “to go” portion of the code
  • 25. lets reduce the “to go” procedures the “to go” portion of the code above are the major new elements remember conceptually the model relies upon movement if a turtle is unhappy
  • 26. Again, we have the “if” the “to go” portion of the code The “to go” button with stop when all turtles are “happy?” Here is how “Happy?” gets set: model continues to tick until every agent is above the “%-similar-wanted” as set on the slider
  • 27. create an agentset of “not happy?” turtles the movement portion of the code For that agentset we run the “find-new-spot” procedures We know from the “to go” procedures that this is going to continue to run until the “if” condition is satisfied
  • 30. the movement portion of the code Notice that it is going to re-run the “find-new-spot” If the “if” condition is met In other words, agents are going to move until they find a open patch then agent will occupy the center of open patch
  • 32. Thinking about Extensions to the Schelling Model This is closer to a “representative agent” model Agents are homogenous in their %similar-wanted In reality, there is likely variance across agents In other words, comparing across agents there are differential preferences with respect to the %similar-wanted
  • 33. Thinking about Extensions to the Schelling Model spatial considerations The 8 neighbors might not be how individuals actually make their assessments agents might make choices based upon a wider assessment of the neighborhood there might be different “prices” for different patches (i.e. a simulated housing market)
  • 34. Thinking about Extensions to the Schelling Model structural considerations the model could encode certain barriers to entry to particular neighborhoods barriers could be highly asymmetric (i.e. red turtles face no barriers and green turtles face high barriers)
  • 36. An Exercise Start With the Default Implementation of Social Segregation Imagine that you are interested in developing a certain style of integration
  • 37. Modify the Code as Needed in Order to Produce The Closest Possible Model Run to the Camouflage Note: this involves 4 Groups not 2 Groups Your Goal! Homework Exercise
  • 38. Send Me Your Best Effort daniel.martin.katz@gmail.com I will announce the Winner
  • 43. Simple Birth Rates take a few minutes and play around with the model consider the questions offered above
  • 44. Thinking Conceptually: Simple Birth Rates What Does the Turtle Movement Add to the Model? Are Turtles Added to the Model? and If So How? Are Turtles Removed from the Model? and If So How?
  • 46. Step 1: map the dependancies Step 2: learn the syntax and functionality for all unknown primitives Step 3: read each line of code and determine what it doing Simple Birth Rates Step 4: sketch a procedures map that follows the chronology of your program At this point it is more Important for you to go though the models line by line on your own using the above protocol
  • 48. Experiment Basic Setup Simple Birth Rates Death Plots Reproduction Movement
  • 49. Simple Birth Rates “To Setup” Procedures
  • 51. Simple Birth Rates Turtle Movement Procedures
  • 53. Simple Birth Rates Take a Look at the Reproduction Procedures
  • 56. Simple Birth Rates Right Click (ctrl + Click on Mac) on the “run experiment” Button
  • 57. Simple Birth Rates forever button Notice observer is selected Calls upon the go-experiment sub-procedures Name of our Button
  • 58. Simple Birth Rates Take a look at this for later in the week Automation is really going to help us