The Modelling Process Dr Andy Evans. This lecture The modelling process: Identify interesting patterns Build a model of elements you think interact and.

Slides:



Advertisements
Similar presentations
A small taste of inferential statistics
Advertisements

Cluster Analysis Purpose and process of clustering Profile analysis Selection of variables and sample Determining the # of clusters.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
Materials for Lecture 11 Chapters 3 and 6 Chapter 16 Section 4.0 and 5.0 Lecture 11 Pseudo Random LHC.xls Lecture 11 Validation Tests.xls Next 4 slides.
Variance reduction techniques. 2 Introduction Simulation models should be coded such that they are efficient. Efficiency in terms of programming ensures.
Review: What influences confidence intervals?
Point estimation, interval estimation
Simple Linear Regression
Correlation 2 Computations, and the best fitting line.
1 Validation and Verification of Simulation Models.
Multivariate Analyses & Programmatic Research Re-introduction to Multivariate research Re-introduction to Programmatic research Factorial designs  “It.
1 Simple Linear Regression Chapter Introduction In this chapter we examine the relationship among interval variables via a mathematical equation.
Sampling Distributions
Testing an individual module
The Calibration Process
G. Cowan Lectures on Statistical Data Analysis 1 Statistical Data Analysis: Lecture 7 1Probability, Bayes’ theorem, random variables, pdfs 2Functions of.
Chemometrics Method comparison
Copyright © 2012 Pearson Education. All rights reserved Copyright © 2012 Pearson Education. All rights reserved. Chapter 10 Sampling Distributions.
Principal Components An Introduction
Psy B07 Chapter 1Slide 1 ANALYSIS OF VARIANCE. Psy B07 Chapter 1Slide 2 t-test refresher  In chapter 7 we talked about analyses that could be conducted.
Gaussian process modelling
Bivariate Relationships Analyzing two variables at a time, usually the Independent & Dependent Variables Like one variable at a time, this can be done.
Programming for Geographical Information Analysis: Advanced Skills Lecture 10: Modelling II: The Modelling Process Dr Andy Evans.
1 Validation & Verification Chapter VALIDATION & VERIFICATION Very Difficult Very Important Conceptually distinct, but performed simultaneously.
The Modelling Process Dr Andy Evans. This lecture The modelling process: Identify interesting patterns Build a model of elements you think interact and.
Hydrologic Modeling: Verification, Validation, Calibration, and Sensitivity Analysis Fritz R. Fiedler, P.E., Ph.D.
Testing Theories: Three Reasons Why Data Might not Match the Theory Psych 437.
Estimation of Statistical Parameters
Stochastic Algorithms Some of the fastest known algorithms for certain tasks rely on chance Stochastic/Randomized Algorithms Two common variations – Monte.
Calibration/Optimisation Dr Andy Evans. Preparing to model Verification Calibration/Optimisation Validation Sensitivity testing and dealing with error.
CJT 765: Structural Equation Modeling Class 7: fitting a model, fit indices, comparingmodels, statistical power.
Generic Approaches to Model Validation Presented at Growth Model User’s Group August 10, 2005 David K. Walters.
VI. Evaluate Model Fit Basic questions that modelers must address are: How well does the model fit the data? Do changes to a model, such as reparameterization,
Parallel Programming Overview Dr Andy Evans. A few terms from standard programming Process: a self-contained chunk of code running in its own allocated.
Calibration/Optimisation Dr Andy Evans. Preparing to model Verification Calibration/Optimisation Validation Sensitivity testing and dealing with error.
The Modelling Process Dr Andy Evans. This lecture The modelling process: Identify interesting patterns Build a model of elements you think interact and.
Copyright © 2009 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
Accuracy Assessment Having produced a map with classification is only 50% of the work, we need to quantify how good the map is. This step is called the.
Managerial Economics Demand Estimation & Forecasting.
Copyright © 2012 Pearson Education. All rights reserved © 2010 Pearson Education Copyright © 2012 Pearson Education. All rights reserved. Chapter.
Validation Dr Andy Evans. Preparing to model Verification Calibration/Optimisation Validation Sensitivity testing and dealing with error.
Chapter 5 Parameter estimation. What is sample inference? Distinguish between managerial & financial accounting. Understand how managers can use accounting.
Propagation of Error Ch En 475 Unit Operations. Quantifying variables (i.e. answering a question with a number) 1. Directly measure the variable. - referred.
Data Analysis Econ 176, Fall Populations When we run an experiment, we are always measuring an outcome, x. We say that an outcome belongs to some.
Chapter 10 Verification and Validation of Simulation Models
Research Methodology and Methods of Social Inquiry Nov 8, 2011 Assessing Measurement Reliability & Validity.
Chapter 12 Confidence Intervals and Hypothesis Tests for Means © 2010 Pearson Education 1.
1 Summarizing Performance Data Confidence Intervals Important Easy to Difficult Warning: some mathematical content.
Week 6. Statistics etc. GRS LX 865 Topics in Linguistics.
1 Introduction to Statistics − Day 4 Glen Cowan Lecture 1 Probability Random variables, probability densities, etc. Lecture 2 Brief catalogue of probability.
G. Cowan Lectures on Statistical Data Analysis Lecture 8 page 1 Statistical Data Analysis: Lecture 8 1Probability, Bayes’ theorem 2Random variables and.
1 Introduction to Statistics − Day 3 Glen Cowan Lecture 1 Probability Random variables, probability densities, etc. Brief catalogue of probability densities.
Statistics Presentation Ch En 475 Unit Operations.
SAMPLING DISTRIBUTION OF MEANS & PROPORTIONS. SAMPLING AND SAMPLING VARIATION Sample Knowledge of students No. of red blood cells in a person Length of.
SAMPLING DISTRIBUTION OF MEANS & PROPORTIONS. SAMPLING AND SAMPLING VARIATION Sample Knowledge of students No. of red blood cells in a person Length of.
Copyright © Cengage Learning. All rights reserved. 5 Joint Probability Distributions and Random Samples.
Uncertainty and confidence Although the sample mean,, is a unique number for any particular sample, if you pick a different sample you will probably get.
+ Chapter 8 Estimating with Confidence 8.1Confidence Intervals: The Basics 8.2Estimating a Population Proportion 8.3Estimating a Population Mean.
King Faisal University جامعة الملك فيصل Deanship of E-Learning and Distance Education عمادة التعلم الإلكتروني والتعليم عن بعد [ ] 1 جامعة الملك فيصل عمادة.
Chapter 11: Categorical Data n Chi-square goodness of fit test allows us to examine a single distribution of a categorical variable in a population. n.
Implementing Dynamic Data Assimilation in the Social Sciences Andy Evans Centre for Spatial Analysis and Policy With: Jon Ward, Mathematics; Nick Malleson,
Stats Methods at IC Lecture 3: Regression.
32931 Technology Research Methods Autumn 2017 Quantitative Research Component Topic 4: Bivariate Analysis (Contingency Analysis and Regression Analysis)
Linear Regression.
The Calibration Process
CJT 765: Structural Equation Modeling
Materials for Lecture 18 Chapters 3 and 6
Chapter 10 Verification and Validation of Simulation Models
Modelling Dr Andy Evans In this lecture we'll look at modelling.
Introduction to modelling
Presentation transcript:

The Modelling Process Dr Andy Evans

This lecture The modelling process: Identify interesting patterns Build a model of elements you think interact and the processes / decide on variables Verify model Optimise/Calibrate the model Validate the model/Visualisation Sensitivity testing Model exploration and prediction Prediction validation Parallelisation

Preparing to model Verification Calibration/Optimisation Validation Sensitivity testing and dealing with error

Preparing to model What questions do we want answering? Do we need something more open-ended? Literature review what do we know about fully? what do we know about in sufficient detail? what don't we know about (and does this matter?). What can be simplified, for example, by replacing them with a single number or an AI? Housing model: detail of mortgage rates’ variation with economy, vs. a time-series of data, vs. a single rate figure. It depends on what you want from the model.

Data review Outline the key elements of the system, and compare this with the data you need. What data do you need, what can you do without, and what can't you do without?

Data review Model initialisation Data to get the model replicating reality as it runs. Model calibration Data to adjust variables to replicate reality. Model validation Data to check the model matches reality. Model prediction More initialisation data.

Model design If the model is possible given the data, draw it out in detail. Where do you need detail. Where might you need detail later? Think particularly about the use of interfaces to ensure elements of the model are as loosely tied as possible. Start general and work to the specifics. If you get the generalities flexible and right, the model will have a solid foundation for later.

Model design Agent Step Person GoHome GoElsewhere Thug Fight Vehicle Refuel

Preparing to model Verification Calibration/Optimisation Validation Sensitivity testing and dealing with error

Verification Does your model represent the real system in a rigorous manner without logical inconsistencies that aren't dealt with? For simpler models attempts have been made to automate some of this, but social and environmental models are waaaay too complicated. Verification is therefore largely by checking rulesets with experts, testing with abstract environments, and through validation.

Verification Test on abstract environments. Adjust variables to test model elements one at a time and in small subsets. Do the patterns look reasonable? Does causality between variables seem reasonable?

Model runs Is the system stable over time (if expected)? Do you think the model will run to an equilibrium or fluctuate? Is that equilibrium realistic or not?

Preparing to model Verification Calibration/Optimisation Validation Sensitivity testing and dealing with error

Parameters Ideally we’d have rules that determined behaviour: If AGENT in CROWD move AWAY But in most of these situations, we need numbers: if DENSITY > 0.9 move 2 SQUARES NORTH Indeed, in some cases, we’ll always need numbers: if COST buy CAR Some you can get from data, some you can guess at, some you can’t.

Calibration Models rarely work perfectly. Aggregate representations of individual objects. Missing model elements Error in data If we want the model to match reality, we may need to adjust variables/model parameters to improve fit. This process is calibration. First we need to decide how we want to get to a realistic picture.

What are we going to calibrate against? Initialisation: do you want your model to: evolve to a current situation? start at the current situation and stay there? What data should it be started with? You then run it to some condition: some length of time? some closeness to reality? Compare it with reality (we’ll talk about this in a bit).

Calibration methodologies If you need to pick better parameters, this is tricky. What combination of values best model reality? Using expert knowledge. Can be helpful, but experts often don’t understand the inter-relationships between variables well. Experimenting is lots of different values. Rarely possible with more than two or three variables because of the combinatoric solution space that must be explored. Deriving them from data automatically.

Solution spaces A landscape of possible variable combinations. Usually want to find the minimum value of some optimisation function – usually the error between a model and reality. Potential solutions Optimisation of function Local minimaGlobal minimum (lowest)

Calibration Automatic calibration means sacrificing some of your data to generating the optimisation function scores. Need a clear separation between calibration and data used to check the model is correct or we could just be modelling the calibration data, not the underlying system dynamics (“over fitting”). To know we’ve modelled these, we need independent data to test against. This will prove the model can represent similar system states without re-calibration.

Preparing to model Verification Calibration/Optimisation Validation Sensitivity testing and dealing with error

Validation Can you quantitatively replicate known data? Important part of calibration and verification as well. Need to decide on what you are interested in looking at.

Validation If we can’t get an exact prediction, what standard can we judge against? Randomisation of the elements of the prediction. eg. Can we do better at geographical prediction of urban areas than randomly throwing them at a map. Doesn’t seem fair as the model has a head start if initialised with real data. Business-as-usual If we can’t do better than no prediction, we’re not doing very well. But, this assumes no known growth, which the model may not.

Validation Visual or “face” validation eg. Comparing two city forms. One-number statistic eg. Can you replicate average price? Spatial, temporal, or interaction match eg. Can you model city growth block-by-block?

Visual comparison

Comparison stats: space and class Could compare number of geographical predictions that are right against chance randomly right: Kappa stat. Construct a confusion matrix / contingency table: for each area, what category is it in reality, and in the prediction. Fraction of agreement = ( ) / ( ) = 0.6 Probability Predicted A = ( ) / ( ) = 0.5 Probability Real A = (10 + 5) / ( ) = 0.3 Probability of random agreement on A = 0.3 * 0.5 = 0.15 Predicted APredicted B Real A10 areas5 areas Real B15 areas20 areas

Comparison stats Equivalents for B: Probability Predicted B = (5 + 20) / ( ) = 0.5 Probability Real B = ( ) / ( ) = 0.7 Probability of random agreement on B = 0.5 * 0.7 = 0.35 Probability of not agreeing = = 0.65 Total probability of random agreement = = 0.5 Total probability of not random agreement = 1 – ( ) = 0.5 κ = fraction of agreement - probability of random agreement probability of agreeing not randomly = 0.1 / 0.50 = 0.2

Comparison stats Tricky to interpret κStrength of Agreement < 0None 0.0 — 0.20Slight 0.21 — 0.40Fair 0.41 — 0.60Moderate 0.61 — 0.80Substantial 0.81 — 1.00Almost perfect

Comparison stats The problem is that you are predicting in geographical space and time as well as categories. Which is a better prediction?

Comparison stats The solution is a fuzzy category statistic and/or multiscale examination of the differences (Costanza, 1989). Scan across the real and predicted map with a larger and larger window, recalculating the statistics at each scale. See which scale has the strongest correlation between them – this will be the best scale the model predicts at? The trouble is, scaling correlation statistics up will always increase correlation coefficients.

Correlation and scale Correlation coefficients tend to increase with the scale of aggregations. Robinson (1950) compared illiteracy in those defined as in ethnic minorities in the US census. Found high correlation in large geographical zones, less at state level, but none at individual level. Ethnic minorities lived in high illiteracy areas, but weren’t necessarily illiterate themselves. More generally, areas of effect overlap: Road accidents Dog walkers

Comparison stats So, we need to make a judgement – best possible prediction for the best possible resolution.

Comparison stats: Graph / SIM flows Make an origin-destination matrix for model and reality. Compare the two using some difference statistic. Only problem is all the zero origins/destinations, which tend to reduce the significance of the statistics, not least if they give an infinite percentage increase in flow. Knudsen and Fotheringham (1986) test a number of different statistics and suggest Standardised Root Mean Squared Error is the most robust.

Preparing to model Verification Calibration/Optimisation Validation Sensitivity testing and dealing with error

Errors Model errors Data errors: Errors in the real world Errors in the model Ideally we need to know if the model is a reasonable version of reality. We also need to know how it will respond to minor errors in the input data.

Sensitivity testing Tweak key variables in a minor way to see how the model responds. The model maybe ergodic, that is, insensitive to starting conditions after a long enough run. If the model does respond strongly is this how the real system might respond, or is it a model artefact? If it responds strongly what does this say about the potential errors that might creep into predictions if your initial data isn't perfectly accurate? Is error propagation a problem? Where is the homeostasis?

Prediction If the model is deterministic, one run will be much like another. If the model is stochastic (ie. includes some randomisation), you’ll need to run in multiple times. In addition, if you’re not sure about the inputs, you may need to vary them to cope with the uncertainty.

Monte Carlo testing Where inputs have a distribution (error or otherwise), sample from this using Monte Carlo sampling: Sample such that the likelihood of getting a value is equal to its likelihood in the original distribution. Run the model until the results distribution is clear. Estimates of how many runs are necessary run from 100 to 1000s.

Identifiability In addition, it may be that multiple sets of parameters would give a model that matched the calibration data well, but gave varying predictive results. Whether we can identify the true parameters from the data is known as the identifiability problem. Discovering what these parameters are is the inverse problem. If we can’t identify the true parameter sets, we may want to Monte Carlo test the distribution of potential parameter sets to show the range of potential solutions.

Equifinality In addition, we may not trust the model form because multiple models give the same calibration results (the equifinality problem). We may want to test multiple model forms against each other and pick the best. Or we may want to combine the results if we think different system components are better represented by different models. Some evidence that such ‘ensemble’ models do better.

The frontier of modelling Individual level modelling is now commonplace. Data is in excess, including individual-level data. Network speeds are fast. Storage is next to free. So, what is stopping us building a model of everyone/thing in the world? Memory. Processing power.

Memory To model with any reasonable speed, we need to use RAM. Gender: 1bit (0 = male; 1 = female) 1 bit = 1 person 1 byte = 8 people 1Kb = 1024 x 8 = 8192 people 1Mb = 1,048,576 x 8 = 8,388,608 ( x8) people 1 Gb = 1,073,741,824 x 8 = 8,589,934,592 people Seems reasonable then. Typical models running on a PC have access to ~ a gigabyte of RAM memory.

Memory Geographical location (⁰ ′ ″ ‴N &W): 8 ints = 256 bits 1 Gb = 33,554,432 people This isn’t including: a)The fact that we need multiple values per person. b)That we need to store the running code. Maximum agents for a PC ~ 100,000 — 1,000,000.

Processing Models vary greatly in the processing they require. a) Individual level model of 273 burglars searching houses in Leeds over 30 days takes 20hrs. b) Aphid migration model of 750,000 aphids takes 12 days to run them out of a 100m field. These, again, seem ok.

Processing a) Individual level model of 273 burglars searching houses in Leeds over 30 days takes 20hrs. 100 runs = 83.3 days b) Aphid migration model of 750,000 aphids takes 12 days to run them out of a 100m field. 100 runs = 3.2 years Ideally, models based on current data would run faster than reality to make predictions useful!

Issues Models can therefore be: Memory limited. Processing limited. Both.

Solutions If a single model takes 20hrs to run and we need to run 100: a) Batch distribution: Run models on 100 computers, one model per computer. Each model takes 20hrs. Only suitable where not memory limited. b) Parallelisation: Spread the model across multiple computers so it only takes 12mins to run, and run it 100 times. c) Somehow cut down the number of runs needed.

Analysis Models aren’t just about prediction. They can be about experimenting with ideas. They can be about testing ideas/logic of theories. They can be to hold ideas.