University of Glasgow · S1 2026 · FACULTY OF ECONOMICS

ECON5149 Agent-based Modelling in Finance

- one subject, every graph, every model, every mark
11 Chapters61-page Bible
Our own words - no uploaded lecturer files
Built to mirror S1 2026 · updated this semester
The Complete Exam Bible · S1 2026

ECON5149 Overview

Agent-based Modelling in Finance
— simulate traders, order books and learning rules, then explain what emerges
  • 20 credits
  • SCQF level 11
  • Semester 1 2026/27
  • Adam Smith Business School
  • Weekly MATLAB labs

ECON5149 Agent-based Modelling in Finance teaches you to model an economy or a market from the bottom up.

  • Assessed by A 90-minute degree exam (50%), a group video Hackathon (40%) and an individual reflection (10%).
  • Core mechanism Rules become orders, the book turns orders into trades, and trades become the information behind new rules.
  • Hardest step Separating what the trader rule produces from what the market institution produces.
  • How to prepare Trace each model by hand with small numbers, then state one assumption the result depends on.
ECON5149 · University of Glasgow
An independent, AskSia-authored study guide. AskSia is not affiliated with, endorsed by, or sponsored by University of Glasgow; the course code and name are used for identification only.
Assessment

How ECON5149 is assessed

ComponentWeightFormat
Degree exam50%In-person individual examination of 90 minutes, assessing ILOs 1, 2 and 4: what agent-based modelling is and when it helps, methods for modelling agent behaviour, and how agent-based models explain economic and financial outcomes. Main assessment in December.
Oral assessment & presentation: video Hackathon40%Group video presentation of 20 minutes on a team-based modelling problem, assessing ILOs 3 to 6.
Reflective assessment: on video presentation10%Individual written reflection on the group video, 500 words, assessing ILOs 3 to 6.

All three weights, formats and durations are taken from the University of Glasgow 2026-27 course catalogue. The course information slides posted on Moodle as Course Information 2025-26 described the 50% component as an individual report, while the 2026-27 catalogue and the course Moodle page list a degree exam. The Moodle assessment overview is marked as an example and its dates differ from the catalogue's December main assessment period, so take exam and submission dates from the University timetable and Moodle.

Contents · every chapter, one map

What ECON5149 covers

Eleven connected chapters move from the language of agent-based models through the limit-order book and trader signals to zero-intelligence markets and genetic-algorithm learning, each traced by hand with small numbers.

01

Agent-Based Models and Emergence

Lecture 1. Agents, states, behaviour, interaction and schedule; emergence; complicated versus complex systems; when ABM complements equilibrium models.

Agent-Based Models and Emergence sets out the vocabulary the whole course reuses.

  • Definition of an agent-based model and its bottom-up logic
  • Five ingredients: agents, states, behaviour, interaction and schedule
  • Why the update schedule changes the model
  • Emergent outcomes and feedback
  • Complicated versus complex systems
  • ABM as a complement to equilibrium and structural models
02

Schelling Segregation as a First ABM

Lecture 1. Local similarity share, tolerance threshold, path dependence, the limits of the example and the workflow for building an ABM.

Schelling Segregation as a First ABM works through the model the course uses to show emergence with very few moving parts. A city is a grid of cells holding households of two types plus some vacancies.

  • Grid, household types and empty cells
  • Local similarity share and the tolerance threshold
  • Interaction through neighbours' moves
  • The threshold as an experimental parameter
  • Path dependence across runs and move orders
  • What the model does not explain
03

Random Exchange and Emergent Wealth Inequality

Lecture 1 and Lab 1. The give-one-dollar economy, conservation, the zero lower bound, the Gini coefficient and repeated runs.

Random Exchange and Emergent Wealth Inequality studies the give-one-dollar economy, a deliberately bare model in which identical agents pass single dollars to one another at random.

  • Transfer rule for one random transaction
  • Conservation of total wealth and the zero lower bound
  • Why a symmetric rule still produces inequality
  • Geometric shape of the wealth histogram
  • Gini coefficient by hand
  • Individual volatility and aggregate regularity
04

Verification, Validation and Replication

Lectures 1, 2 and 4. Checking code against the conceptual model, micro and macro validation, robustness and reproducible results.

Verification, Validation and Replication covers the three checks that stand between a simulation and an economic conclusion.

  • Verification as code against conceptual model
  • Validation forms: micro, macro, face and robustness
  • Purpose-dependent validation standards
  • Deterministic order-book tests and accounting conservation
  • Replication requirements and seed policies
  • Exact paths versus statistical properties
05

Orders, the Limit-Order Book and Matching

Lecture 2 and Lab 2. Cash and inventory, limit and market orders, bids, asks, spread, depth, price and time priority and the matching rule.

Orders, the Limit-Order Book and Matching builds the trading institution of the course's artificial market before any trader behaviour is added.

  • Cash, inventory and mark-to-market wealth
  • Borrowing and short-sale feasibility rules
  • Last price, best bid, best ask, mid-price and valuations
  • Limit orders, market orders and crossing the book
  • Continuous double auction versus call auction
  • Depth ladders and the bid-ask spread
06

Trader Signals, Expected Prices and Order Placement

Lecture 2. Fundamental, technical and noise signals, weighted expected returns, expected prices, order direction and limit-price placement.

Trader Signals, Expected Prices and Order Placement explains where the orders in an artificial market come from. The lecture notes describe three kinds of trading motive.

  • Fundamental signals from a common or private valuation
  • Momentum and look-back horizons
  • Moving-average, crossover and breakout rules with thresholds
  • Contrarian reading and noise traders
  • Normalised and raw weights for an expected return
  • Expected price, trade direction and limit-price placement
07

Stylised Facts, Liquidity and Model Calibration

Lecture 2. Log returns, fat tails, autocorrelation, volatility clustering, liquidity dimensions, parameter sensitivity and order cancellation.

Stylised Facts, Liquidity and Model Calibration asks what a running artificial market produces and how that output should be judged.

  • Log returns and the choice of clock
  • Heavy tails, kurtosis and excess kurtosis
  • Raw-return versus squared-return autocorrelation
  • Market-quality outputs for design questions
  • Tightness, depth, immediacy and resiliency
  • Depth imbalance near the best quotes
08

Zero-Intelligence Traders and Allocative Efficiency

Lecture 3 and Lab 3. ZI-U and ZI-C quotes, induced values and costs, maximum surplus, allocative efficiency and the event algorithm.

Zero-Intelligence Traders and Allocative Efficiency asks how much of a market's performance survives when traders stop thinking. Lecture 3 keeps the continuous double auction from Lecture 2 and replaces the trader's forecasting rule with random quotes.

  • Trader rule versus market institution
  • Noise traders compared with ZI-U and ZI-C
  • Induced values, induced costs and trader profits
  • Maximum surplus and the efficient quantity by sorting
  • Allocative efficiency, intramarginal and extramarginal traders
  • The event algorithm and hand-traced order sequences
09

Price Convergence, ZIP and Adaptive Bubbles

Lecture 3. Competitive price intervals, Gode and Sunder, Cliff and Bruten, ZIP, order-book ZI models and adaptive bubble dynamics.

Price Convergence, ZIP and Adaptive Bubbles picks up where efficiency leaves off.

  • Competitive price interval and the distance measure
  • Efficiency versus price convergence
  • Gode and Sunder findings and protocol differences
  • Cliff and Bruten expected prices under three schedules
  • Zero Intelligence Plus as minimal adaptation
  • Order-book event models and stylised facts
10

Learning Rules and Genetic Algorithm Operators

Lecture 4. Learning types, chromosomes, forecast fitness, tournament selection, crossover, mutation, elitism and population replacement.

Learning Rules and Genetic Algorithm Operators covers the point in the course where behaviour stops being a fixed input.

  • Operational definition of learning in an agent-based model
  • Individual, social and population learning compared
  • The technical share as gene, chromosome and population
  • Market module and GA_UPDATE as separate loops
  • Fitness as minus mean squared forecast error on trades
  • Tournament selection and selection pressure
11

Genetic Algorithm Experiments and Diagnostics

Lecture 4. Fundamental shifts, four diagnostics, mutation experiments, parameter tuning, verification and artificial stock markets.

Genetic Algorithm Experiments and Diagnostics turns an evolving market model into evidence.

  • Purpose of the fundamental-shift experiment
  • Price against fundamental as a market-response test
  • Mean and distribution of the technical share
  • Best and median fitness against median-rule RMSE
  • Mutation-probability experiment and diversity
  • Parameter tuning across grids and seeds

Instead of starting from an aggregate equation, you specify agents, the state each one carries, the rule it follows, how agents interact and the order in which actions happen, then simulate and study the aggregate pattern that emerges.

The University's course description places the method at the meeting point of complex systems, evolutionary programming, game theory, multi-agent systems and reinforcement learning, and asks students to analyse the assumptions and limits of each model as well as to implement it.

The 2026/27 teaching runs through lectures and weekly MATLAB labs.

Lecture 1 sets up the vocabulary with the Schelling neighbourhood model and a give-one-dollar economy that turns identical agents into an unequal wealth distribution.

Lecture 2 builds an artificial financial market around an exchange where buy and sell quotes arrive continuously and wait in an order book, then adds fundamental, technical and noise trading signals and the stylised facts that an artificial market should reproduce. Lecture 3 removes almost all intelligence from traders to show how much the market institution achieves on its own, measured by allocative efficiency.

Lecture 4 lets behaviour evolve, first through one adaptive weight and then through a genetic algorithm acting on a population of forecasting rules. Later lectures apply the same machinery to reinforcement learning, central-bank models, housing and bond markets, and forecasting.

Assessment combines a 90-minute in-person degree exam worth 50% with a group video Hackathon worth 40% and an individual reflection worth 10%.

The exam targets discussion, evaluation and analysis rather than coding, so this guide traces every mechanism by hand with small numbers and ends each chapter with what the model does and does not show.

Worked example · free

Trace three orders through a limit-order book

Q [6 marks]. A one-unit limit-order book holds bids at 41, 40 and 38 and asks at 43, 44 and 46. Three orders arrive in turn: buy limit 42, sell limit 41, buy limit 45. For each order decide whether it trades and at what price, then give the final best bid, best ask and spread. The marks shown here are our own practice guide and not a University allocation.
Best ask (orange) and best bid (blue) are drawn as steps against event number for the six orders of Model 5.1, with black dots at the three trade prices.Best ask (orange) and best bid (blue) are drawn as steps against event number for the six orders of Model 5.1, with black dots at the three trade prices. Look at events 1 and 5: the spread changes although nothing trades.63646566036eventbest askbest bidtrade price
Best ask (orange) and best bid (blue) are drawn as steps against event number for the six orders of Model 5.1, with black dots at the three trade prices. Look at events 1 and 5: the spread changes although nothing trades.
  • 2Buy 42 is below the best ask 43, so it cannot cross. It rests on the bid side and becomes the new best bid, narrowing the spread to 1 without any trade. The marks in this model are an original practice weighting, not a University marking scheme.
  • 2Sell 41 is at or below the best bid 42, so it trades. The price is the resting bid's price, 42, and that bid leaves the book, so the best bid returns to 41.
  • 2Buy 45 is at or above the best ask 43, so it trades at the resting ask price of 43. That ask is removed and the best ask becomes 44. The book ends with best bid 41, best ask 44 and a spread of 3.
Two trades occur, at 42 and then 43, and the final book has best bid 41, best ask 44 and spread 3. The mark allocation is an original practice weighting, not a University marking scheme.
Sia tip — Price every trade at the order already resting in the book; an incoming buy at 45 still pays the resting ask of 43.
Glossary

Key terms

Agent-based model
A simulation in which many individually specified decision makers act on their own rules and their combined interaction produces the aggregate result.
Emergent outcome
An aggregate pattern produced by local rules and interaction rather than imposed directly by the modeller.
Schedule
The order in which agents act and states are updated, treated in the course as part of the economic model.
Continuous double auction
A trading institution in which buyers and sellers both submit prices and each order is processed as it arrives.
Limit-order book
The list of buy and sell quotes still waiting to trade, ranked by price and then by arrival time.
Bid-ask spread
The best ask minus the best bid, one measure of how tight a market is.
Stylised fact
A robust empirical regularity of asset returns, such as fat tails or volatility clustering, used as a validation target.
Zero-intelligence trader
A benchmark trader whose quotes are random, used to isolate what the market institution achieves on its own.
Allocative efficiency
Realised surplus divided by the best achievable surplus, expressed in per cent; it depends on who trades, not on prices.
Competitive price interval
The range of prices at which exactly the efficient number of buyers and sellers are willing to trade.
Genetic algorithm
A population-learning method that evaluates candidate rules, selects and recombines the fitter ones, and mutates some children.
Fitness function
The criterion that defines good behaviour for a genetic algorithm, in the course minus the mean squared forecast error.
Model validation
Judging whether a working model genuinely captures the real phenomenon or mechanism it was built to study.
FAQ

ECON5149 FAQ

How difficult is Agent-based Modelling in Finance?

The course feedback summary calls it an intensive course covering a wide range of financial topics. Some students asked for more basic material before the advanced topics, more coding content and more time for the group task. Half of the result rests on a 90-minute in-person degree exam, so the challenge is explaining mechanisms clearly and quickly rather than writing long programs.

How is the course assessed?

The 2026-27 catalogue lists three components: an in-person individual degree exam of 90 minutes worth 50%, a group video Hackathon presentation of 20 minutes worth 40%, and an individual reflection of 500 words on that video worth 10%. The main assessment is in December. Check Moodle for release and submission times.

What does the degree exam cover?

The catalogue ties the exam to three learning outcomes: discussing what agent-based modelling is and when it helps, evaluating methods for modelling and simulating agent behaviour, and analysing how agent-based models explain features of economic systems and financial markets. Expect to define, compare conventions, trace mechanisms with small numbers and state the limits of a result.

Are past degree exam papers available?

The lecture notes, slides and lab sheets covered by this guide include worked order sequences, surplus tables and discussion questions, but no past degree exam paper or marking scheme. All practice here is newly written and follows the reasoning the labs rehearse, such as tracing an order book or computing allocative efficiency by hand.

Do I need strong programming skills?

The labs use short MATLAB scripts built from loops, vectors and plots, and the lecture notes stress understanding the model rather than a software framework. Lab solutions are released on Moodle after each lab week. For the exam, being able to read pseudocode and trace it by hand matters more than writing code from memory.

What is the Hackathon?

It is the group component: a team-based task to solve an open modelling problem within a short period, submitted as a 20-minute video presentation and worth 40%. Each student then submits an individual reflection of 500 words, worth 10%. Extensions are generally not possible for group work, so plan the timetable early.

What should I revise first before the exam?

Start with the order book and matching rule, because later chapters reuse it. Then practise zero-intelligence surplus and efficiency calculations, and the genetic algorithm steps of selection, crossover, mutation and replacement. Finish with the conceptual chapters on emergence and validation, rehearsing a short statement of what each model does not show.

Chapter questions

Questions students ask in each ECON5149 chapter

Is agent-based modelling a rejection of mainstream economics?
No. The lecture notes describe it as a complement. Equilibrium and structural models are strongest when optimisation, welfare analysis and disciplined policy counterfactuals are central, while agent populations help when heterogeneity, direct interaction, institutions or learning drive the question. The right tool depends on what you need to explain. Chapter 01 · Agent-Based Models and Emergence
Why are empty cells left out of the similarity share?
The share is defined over occupied neighbouring cells, so vacancies affect neither the count of similar households nor the total. This matters in practice because a neighbour leaving can raise or lower a household's share without the household itself doing anything, which is exactly how one relocation sets off another. Chapter 02 · Schelling Segregation as a First ABM
If nobody has an advantage, why does inequality appear?
Each agent's wealth follows its own sequence of random gains and losses, and those sequences differ by chance. Some agents string together favourable draws, others drift down to zero, where they can receive but not give. With total wealth fixed and a floor at zero, the spread settles into a skewed shape even though the rule treats everyone identically. Chapter 03 · Random Exchange and Emergent Wealth Inequality
Can a model pass verification and still be wrong?
Yes. Verification only shows that the code does what the modeller intended. The intended rules might still be implausible or fail to reproduce the patterns that matter, so a perfectly coded model can be a poor model of the target phenomenon. That second question belongs to validation and needs separate evidence. Chapter 04 · Verification, Validation and Replication
Why does a buyer who bids 122 sometimes pay only 121?
The common convention prices a trade at the order that was waiting in the book. A bid of 122 states the most the buyer will accept paying; if a seller was already offering 121, that seller's price is used, so the newcomer receives a better deal than its own limit required. Chapter 05 · Orders, the Limit-Order Book and Matching
Why do the signals use logarithms of price ratios?
A log ratio measures a proportional gap, so a value of 0.02 means roughly a two per cent difference whatever the price level. Writing the fundamental, technical and noise inputs this way puts them on a common return-like scale, which is what allows them to be weighted and added into a single expected return. Chapter 06 · Trader Signals, Expected Prices and Order Placement
Why look at squared returns when raw returns show almost no autocorrelation?
Raw returns carry the sign of each move, and signs are close to unpredictable. Squaring removes the sign and keeps the size, so positive autocorrelation in squared returns reveals that turbulent stretches and quiet stretches each persist, even though the direction of the next move remains hard to forecast. Chapter 07 · Stylised Facts, Liquidity and Model Calibration
Does zero intelligence mean the course thinks traders are irrational?
No. Random quoting is a methodological device that strips purposeful price choice out of the trader. If high efficiency survives that removal, the trading institution and the no-loss restriction must be responsible for much of it. The lecture notes describe zero intelligence as a benchmark rather than a description of how investors actually behave. Chapter 08 · Zero-Intelligence Traders and Allocative Efficiency
Why is the competitive price not a single number here?
With traders who each buy or sell once, demand and supply are step functions. Any price at which exactly the efficient buyers and sellers are willing, and every other trader is not, is consistent with equilibrium, so a whole interval qualifies. Its midpoint is handy for plotting a reference line but is not imposed on the simulation. Chapter 09 · Price Convergence, ZIP and Adaptive Bubbles
Is the technical share a fourth weight in the forecast?
No. The noise weight is fixed first, and the technical share only divides what remains between fundamental and trend signals. A share of 0.5 with a noise weight of 0.2 therefore puts 0.4 on each systematic signal, and the three weights still add to one for every possible gene value. Chapter 10 · Learning Rules and Genetic Algorithm Operators
Why do forecast errors jump right after the fundamental rises?
The fundamental signal suddenly becomes large and positive, so rules that lean on it predict a big next return. Prices, however, climb gradually because orders must cross resting quotes in the book, so realised returns stay small. The gap between predicted and realised returns inflates squared errors, and the GA update itself does not cause the jump. Chapter 11 · Genetic Algorithm Experiments and Diagnostics
Study strategy

How to study for the exam

Study the course as one growing machine. First, make the five ingredients automatic: for every model, write down the agents, their states, the behavioural rule, the interaction and the schedule before reading any results. Second, rebuild the limit-order book on paper until you can process any incoming order in seconds, always pricing the trade at the resting quote.

Third, practise the signal chain from fundamental, technical and noise signals to an expected return, an expected price, a side and a limit price, using natural logarithms and four decimal places. Fourth, drill zero-intelligence markets by sorting values and costs, computing the maximum surplus and the competitive interval, then tracing a short event sequence and its efficiency.

Fifth, run one genetic-algorithm generation by hand: score rules by minus mean squared forecast error, hold tournaments, cross over, mutate and clip, and count elites and children. In the final fortnight, alternate one hand-traced mechanism with one short written comparison each day, and end every practice answer with a sentence on what the model does not show.

Study ECON5149 with AI

Your AI Economics tutor for ECON5149

Stuck on a hard ECON5149 question? Sia is AskSia’s AI Economics tutor — ask any ECON5149 Agent-based Modelling in Finance question and get a clear, step-by-step explanation grounded in how the course is actually taught and assessed. Read this whole study guide free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 26 of your subjects at University of Glasgow, plus 1,000+ more Bibles across the AskSia library.
Sia - your ECON5149 tutor, unlimited, worked the way the exam marks it
The full 61-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works