Computational Approaches to the Non-Observed EconomyFoundations

Module 2Theory-based and data-driven modelling

In most empirical work the outcome can be counted. Here the target is hidden: latent, rebuilt by someone else's model, or seen only for a few people. Studying it needs a production story and an observation story. We look at the mechanisms theory offers, five modelling objectives that are often confused, a strong association that is a weak lever, a cross-country slope with the wrong sign, and then the data side: labels and their status, provenance, coverage, timing and leakage, and a division of labour between theory and data. Forty invented countries keep every claim checkable.

By the end you should be able to separate the production and observation stories, match a model to its objective, recognise when an association is not a lever, audit a dataset for label status and leakage, and choose a check that matches the use.

Key ideas, one per video

  • Video 3The flexible model's good score came from recognising countries it had seen. Ten more points of digital payments go with 5.2 fewer points of hidden activity across countries; pushing them up by ten points, all else fixed, cuts it by 0.3.
  • Video 4A model trained on an estimate learns the estimate (8.3 points from the truth on new countries, against 6.5 for the estimate itself). The split must match the use, and last year's value (2.4 points) beat a random forest (3.4).

Book: Chapter 2 of Computational Approaches to the Non-Observed Economy: From Theory to Practice (coming soon). The videos and slides follow the chapter’s topics in our own words, figures and simulations; the towns and countries are invented, and nothing is copied from the book.

The title slide of Module 2: Theory-based and data-driven modelling

39 slides, written to be read on your own, with worked examples, our own small simulations and check-yourself questions (answers at the end). PDF, 7.3 MB.

Watch

2 videos for this module, each about 8 to 11 minutes. Pick one from the list, and open the transcript to read along: each timestamp plays the video from there. The narration is generated with a voice clone of Teddy, used with his permission.

Video 3 · 9:57

When the target itself is hidden

Two models of a published estimate score 4.5 and 8 points. Against the truth, both are off by about 8.

The flexible model's good score came from recognising countries it had seen. Ten more points of digital payments go with 5.2 fewer points of hidden activity across countries; pushing them up by ten points, all else fixed, cuts it by 0.3.

TranscriptVideo 3
0:00

Two models, three scores. Here are forty countries, sixteen years each. For every country and year, someone has published an estimate of its hidden economy. We train two models to predict that published estimate. One is flexible: a random forest that sees everything we have. The other is simple, and only uses variables that theory says matter. Test them on a random quarter of the rows. The flexible model is off by about 4.5 points. The simple one, by 8. Now test them on ten countries they have never seen. The flexible model's error jumps to almost 7 points. The simple one barely moves. And here's the twist. These countries are invented, so we know the true hidden share. Against the truth, both models are off by about 8 points. So which number would you report? That question is what this module is about.

0:55

Two stories. Welcome to Module 2: theory-based and data-driven modelling. In most empirical work, the thing you're explaining can be measured. People argue about why unemployment changes, but they can count the unemployed. Here, the target itself is hidden. It's latent, or reconstructed by somebody's model, or observed only for a few people. So every study of the hidden economy needs two stories. A production story: how hidden activity arises. And an observation story: how evidence about it reaches us. Theory is good at the first. Data are good at testing both. In this video, we look at what theory brings, and what each kind of model is for. The plan: first the mechanisms theory gives us, then the five things a model can be for, then a trap about prediction and policy, then what makes a model theory-based, and finally back to our two models.

1:46

Mechanisms. Start with concealment. Economists have long modelled crime and tax evasion as a choice: people compare what they gain from hiding with what they expect to lose if caught. That gives hiding an economic logic. But real people don't know the audit probability. They act on the risk they believe in, shaped by experience, advisers and rumours. Information is part of the mechanism too. When an employer reports your wage, there's little to hide. With value added tax, one firm's sale is another firm's purchase, so their reports can be checked against each other. Digital invoices and payments add more traces. But data only deter if the tax office can link them and use them. Then there's social life. People learn from their neighbours what is normal and what is risky. And trust matters: people pay more willingly when they see taxes as fair and services as worth it. Informal firms need a different story: the costs and benefits of registering, and the jobs that are actually available. Illegal markets need another: prohibition, secrecy and trusted networks. And statistical omissions need a story about the observer: registers, samples and classifications. A theory of the hidden economy must include the observation process, not only the production process. Notice that no single mechanism covers all of this. Hiding sales, running an unregistered shop, selling something illegal and being missed by a register are different processes. A model has to be built for the process you're studying.

3:10

Five objectives. Before choosing a model, choose the objective. There are five, and they're often confused. Measurement asks how big the hidden economy is, now or in the past. It's judged by how credible the reconstruction is, and how honest its uncertainty. Explanation asks why it exists, or why it changed. It needs mechanisms, and it's judged by whether those mechanisms account for the patterns we see. Prediction asks what will happen next, using only what's known today. It's judged on data the model has never seen, in time order. Simulation asks how individual choices add up. It's judged by whether it reproduces patterns at both the small and the large scale. And policy asks what would happen if we changed something. That needs a counterfactual, which is much more than a good prediction. In our forty countries, the five look like this. Measurement: how big was the hidden share in country twelve last year? Explanation: why is it falling there? Prediction: what will it be next year? Simulation: how do millions of individual choices add up to that number? And policy: what happens if country twelve doubles its audits? A model can be excellent at one of these and useless at another. A random forest can predict well and explain nothing.

4:22

Prediction is not policy. Here is why prediction is not policy. In our forty countries, places with more digital payments have less hidden activity. Across countries, ten more points of digital payments go with about 5 fewer points of hidden activity. So, should a government push digital payments up by ten points? Pause for a moment, and guess how much hidden activity would fall. We can actually run that experiment, because we built this world. Force digital payments up by ten points, and keep everything else the same. Hidden activity falls by about a third of a point. Not five. A third of one. Why? Because in this world, strong institutions drive both. They bring digital payments, and they bring enforcement and trust. Digital payments mostly ride along. Draw it as arrows. Institutions point to digital payments. Institutions also point to enforcement and trust, and those point to hidden activity. Digital payments have only a thin arrow of their own. Any variable with a strong common cause can look like a lever. Theory is what tells you which arrows exist. A model that predicts well will happily use digital payments as a clue. That's fine for prediction. It's wrong for policy.

5:39

Theory-based models. So what makes a model theory-based? Not equations. The structure comes from an economic argument, made before the model sees the data. A linear regression isn't automatically theory. And a machine-learning model can carry a lot of theory: which variables enter, which signs are allowed, which actions are possible. The classic evasion model is a good template. One person chooses how much income to report. Then you can add beliefs, norms, trust, third-party reports, or repeated audits, and solve it with a computer. Firms work the same way. Register or not, declare how much, pay workers formally or not, accept cards or cash. Theory says why each choice matters. Data say how much. The strength of theory is interpretation. Its weakness is identification. Here's a warning from our own world. In this world, raising taxes makes people hide more. We built it that way. Five extra points of tax adds about a point of hidden activity. Yet across countries, higher-tax countries hide less. Five more points of tax go with almost 9 fewer points of hidden activity. Same world, opposite signs. Strong institutions raise both taxes and compliance. The correlation tells you about institutions, not about taxes.

6:55

Proxies. Some of the oldest size estimates were theory-based too. Currency demand methods assume that hidden trade needs extra cash, beyond what normal habits explain. Electricity methods assume that production needs power, recorded or not. And latent-variable models combine several causes and several indicators at once. Each made a hidden quantity approachable. Each also leans on a proxy with other causes. Cash depends on banking, interest rates and habits. Power depends on technology and climate. Latent-variable models tried to fix that by listening to many causes and many indicators at once: tax burden, regulation and unemployment on one side; cash, power and working hours on the other. That spreads the risk across several proxies. But it raises new questions: is the hidden quantity really identified, and in what units is it measured? The published estimate in our forty countries is built that way. It leans on cash use. It follows the truth closely, with a correlation of zero point nine two. But it's off by about 6 points on average. It's too high where cash is common, and too low where it's rare.

8:02

Name tags. Back to our two models. Why did the flexible one look so good on random rows? Because a country's years look almost alike. From one year to the next, the hidden share has a correlation of zero point nine four. A random split puts a country's neighbours in training and its other years in the test. The forest learns each country's quirks. Population, for example, is fixed for each country, so it works like a name tag. On new countries, the name tags are useless, and the error grows by half. The simple model has no name tags, so its score barely moves. That's honest. But it isn't more accurate against the truth. So report both scores, and say which one matches your use. If you'll apply the model to countries it has never seen, the random-split score is the wrong one to quote. And there's a deeper problem. Both models learned the published estimate, not the hidden economy. We'll take that apart in the next video.

8:57

Recap. Let's recap. The hidden economy needs two stories: how activity arises, and how evidence about it is produced. Theory brings mechanisms: incentives and information, norms and trust, the costs of formality, prohibition, and the observer itself. Measurement, explanation, prediction, simulation and policy are different objectives, judged in different ways. A strong association can be a weak lever. And a correlation across countries can have the opposite sign to the mechanism. In the lab, you'll build the forty countries yourself, train both models, and switch between random and country splits. Next: ground truth, leakage, and how to make theory and data work together.

Interactive lab

Forty countries

Build forty invented countries, train a simple theory-guided model and a flexible one on a published estimate, and switch between random and country splits and between scoring against the estimate and against the truth. Then switch on a payments reform.

The countries are simulated in your browser (a hidden share driven by institutions, taxes and payments, and a published estimate that leans on cash). Four challenges are checked as you go.

Simple math

Forty invented countries, sixteen years each

The true hidden share depends on taxes, enforcement, trust, self-employment and digital payments, plus each country's quirks. A published estimate leans on cash use, so it runs high where cash is common and low where it is rare. Both models learn the published estimate.

Simple, theory-guided
logit(ŝ) = w₀ + Σ wⱼ·causeⱼ

A linear model on the five causes theory names.

Flexible
ŝ = average of k nearest

Nearest neighbours on the causes, plus population if you allow it: a number fixed for each country, which works like a name tag.

The reform
year 10: e-invoicing

Half the countries move payments to cards. Hiding falls a little; cash falls a lot.

Simple model
–
Flexible model
–
Published estimate vs truth
–

Running…

Errors on the held-out rows

Points of hidden share.

The reform, in the reform countries

Change after year 10 compared with year 9, in points.

Published estimate says
–
Truth changed by
–
Reform's true effect
–

Challenges

Each one is checked on the settings you have tried.

  1. Scoring against the published estimate, with the name tag on, find a k where the flexible model beats the simple one on random rows but loses on whole countries.
  2. Score against the truth, and find settings where both models are further from the truth than the published estimate they learned from.
  3. Switch on the reform and see the published estimate's drop come out more than one and a half times the reform's true effect.
  4. On random rows, take the name tag away and watch the flexible model's error rise by more than half a point.