University of Glasgow · FACULTY OF ECONOMICS

ECON5149 Chap.10 Learning Rules and Genetic Algorithm Operators

- one subject, every graph, every model, every mark
8 Chapters5-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 10 of 11 · ECON5149

Learning Rules and Genetic Algorithm Operators

Learning Rules and Genetic Algorithm Operators covers the point in the course where behaviour stops being a fixed input. A model learns when information produced inside the simulation alters behaviour used later, and the chapter separates three versions of that idea: an agent revising its own parameter, an agent copying others, and a population whose mix of rules evolves.

The genetic algorithm makes the third version concrete. Each trader carries one chromosome holding a single gene, the technical share, which divides the non-noise weight between the fundamental and trend signals while the noise weight stays fixed. Trading itself runs through the same order book as before.

Around it sits a second loop: after a block of market events every rule is scored by how well its systematic forecast matched realised transaction returns, the best few are kept, and the rest of the next population is bred through tournaments, convex crossover, occasional mutation and clipping.

You will trace each operator by hand with fresh numbers, check that weights still sum to one, and count elites, births and tournaments so that a population update can be audited line by line.

In this chapter

What this chapter covers

  • 01

    Operational definition of learning in an agent-based model

  • 02

    Individual, social and population learning compared

  • 03

    The technical share as gene, chromosome and population

  • 04

    Market module and GA_UPDATE as separate loops

  • 05

    Fitness as minus mean squared forecast error on trades

  • 06

    Tournament selection and selection pressure

  • 07

    Crossover, mutation, clipping and elitism

  • 08

    Population accounting for elites and births

Worked example · free

Cross, mutate and clip two technical-share rules

Q [6 marks]. With a fixed noise share of 0.25, parents have technical shares 0.30 and 0.80 and crossover draws 0.70 on the first parent. Mutation adds +0.08. Find the child, its three weights, and the result if a different child at 0.05 receives a mutation step of -0.09. The mark allocation is a self-check device, not a University one.
The horizontal line is the admissible interval for the technical share, from 0 to 1; the shaded band is every child that crossover of 0.25 and 0.65 can produce,The horizontal line is the admissible interval for the technical share, from 0 to 1; the shaded band is every child that crossover of 0.25 and 0.65 can produce, while mutation arrows show steps of minus 0.06 and plus 0.13, the second clipped back to 1.01θ(1) = 0.25θ(2) = 0.65child 0.49mutated 0.430.93 + 0.13clipped to 1crossover range
The horizontal line is the admissible interval for the technical share, from 0 to 1; the shaded band is every child that crossover of 0.25 and 0.65 can produce, while mutation arrows show steps of minus 0.06 and plus 0.13, the second clipped back to 1.
  • 2Crossover gives 0.70 x 0.30 + 0.30 x 0.80 = 0.21 + 0.24 = 0.45, which lies between the parents.
  • 1Mutation moves the child to 0.45 + 0.08 = 0.53, still inside [0, 1], so no clipping is needed.
  • 2The non-noise share is 0.75, so the fundamental weight is 0.75 x 0.47 = 0.3525, the technical weight is 0.75 x 0.53 = 0.3975 and the noise weight is 0.25; together they equal 1.
  • 1The other child moves to 0.05 - 0.09 = -0.04, outside the admissible interval, so clipping returns 0 and its weights become 0.75, 0 and 0.25.
The mutated child has technical share 0.53 with weights 0.3525, 0.3975 and 0.25, and the second child is clipped to a purely fundamental systematic rule. The mark allocation is an original practice weighting, not a university marking scheme.
Sia tip — After every crossover, mutation or clip, recompute the three weights and confirm they add to exactly one before moving on.
Glossary

Key terms

Population learning
Adaptation in which the distribution of candidate rules changes because successful rules survive or reproduce and new rules are built from existing ones.
Chromosome
The encoded candidate rule carried by one trader, here a single technical share between zero and one.
Tournament selection
Choosing a parent by sampling a fixed number of distinct rules at random and keeping the one with the highest fitness.
Selection pressure
The strength with which fitter rules are favoured, raised by enlarging the tournament size.
Elitism
Copying the highest-fitness rules unchanged into the next generation so that chance cannot remove them.
FAQ

Learning Rules and Genetic Algorithm Operators FAQ

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.

Why are rules scored even when their trader did not submit an order?

Every rule produces a counterfactual systematic forecast at each event, so each one can be compared with the same realised trade return. That keeps the comparison fair regardless of how often a trader happened to be scheduled. It is an accuracy assumption about forecasts, not a statement that those traders earned profits.

Can crossover alone discover a completely new strategy?

Convex crossover always lands between its two parents, so a population packed into a narrow band of technical shares stays in that band. Mutation is the operator that can step outside the existing range, with clipping keeping the result admissible. Selection decides which rules contribute, but neither it nor crossover supplies new extremes.

Study strategy

Exam move

Begin by rewriting the weight formulas from memory and testing them on three gene values, including the two end points, until the sum-to-one check is automatic. Next, draw the two loops side by side: the market chain that turns signals into orders and trades, and the learning loop that turns trades into fitness and a new population. Label which quantities pass between them, because the only link is the fitness vector.

Then build a small population of five or six rules, invent three trades with your own signals and returns, and compute each systematic forecast, squared error and fitness. Divide by the number of trades rather than the number of events, and remember that higher fitness means closer to zero. Run two tournaments by hand with overlapping samples and notice when the population's best rule is never drawn.

Repeat with a larger tournament size to feel how selection pressure changes outcomes. For crossover and mutation, sketch a number line from zero to one, shade the band between the parents, and mark where a mutation lands and where clipping returns it.

Finally, practise population accounting with a size and elite count of your own choosing, writing out elites, births and tournament totals, and explain in one sentence each why children never become parents within the same update and why elitism is optional but useful. Lab 4 asks you to locate these same pieces in working code, so pair each hand calculation with the function where it happens.

Working through Learning Rules and Genetic Algorithm Operators in ECON5149? Sia is AskSia’s AI Economics tutor — ask any ECON5149 Learning Rules and Genetic Algorithm Operators question and get a clear, step-by-step explanation grounded in how ECON5149 is taught and assessed. Read this chapter 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 5-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