Estimating Models
How is a model's hidden machinery measured from the choices it predicts?
The part opens on BART: an official forecast of about 15% of work trips, Daniel McFadden's 6.3% from a model of commuters' choices, and 6.2% in 1975. On the Island, where the truth is planted: a straight line through a fuel-price history predicts a negative share of drivers under a congestion charge, a logit does not; McFadden's logit by maximum likelihood, the value of time, and a railway forecast undone by the independence of irrelevant alternatives. The viewer asks which of four facts separates patience from caution (none). Hansen's GMM on the Euler equation with the J-test; simulated moments and indirect inference; the life-cycle household estimated by simulated moments with the truth recovered on a narrow ridge. After an intermission of America's vehicle miles since 1971, hidden types and spurious habit, Andrews, Gentzkow and Shapiro's sensitivity matrix and a 1% error in wealth worth 38 standard errors, calibration against estimation, Chetty's sufficient statistics, Todd and Wolpin's validation, Manski's bounds, the risk-aversion dial, estimation at work, Google Flu Trends as Called it?, and learned estimators.
What you need. Part 4: the Lucas critique and instruments; Part 5: random utility; Part 22: the life-cycle household; Part 42: sufficient statistics; Part 44: Rust's buses; Statistics, Built: likelihood, GMM, the bootstrap and partial identification.
- Hook
- McFadden forecasts a railway that is not built yet
- Ideas, models and mathematics
- the method of moments generalized, maximum likelihood, simulated moments and indirect inference, discrete choice, dynamic models, identification and sensitivity, sufficient statistics against structure, validating a model with an experiment
- Agora gains
agora.estimate: the estimation harness- Play it
- which moment pins down which parameter?
What you will be able to do
Principles and the major
- Explain why a forecast of a new policy needs a model of why people choose, not a pattern in history.
- Read a value of time off a logit's coefficients.
Graduate
- Estimate a logit by maximum likelihood and a model by GMM, with standard errors and the J-test.
- Estimate a model you can only simulate, by simulated moments or indirect inference.
- Diagnose weak identification and compute the sensitivity of an estimate to its moments.
Research
- Derive the efficient GMM weighting and the (1 + 1/S) correction, and the spurious state dependence a hidden type creates.
- Derive Manski's bounds and narrow them with a monotonicity assumption.
Practice
- Estimate demand for a new product or service and say which facts in the data the forecast leans on, before anyone acts on it.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Principles and the major 13 min · Graduate 41 min · Research 46 min · Practice 15 min.
- 0The railway forecastPrinciples and the major3 min
- 1What "structural" meansPrinciples and the major2 min
- 2Random utility and maximum likelihoodPrinciples and the major5 min
- 3Play it: which fact pins down which parameter?Graduate3 min
- 4The generalized method of momentsGraduate4 min
- 5When the likelihood has no formulaGraduate3 min
- 6The Island's households, estimatedGraduate3 min
- Intermission: America's driving, 1971-2026Principles and the major
- 7Dynamic choices and hidden typesGraduate3 min
- 8IdentificationResearch3 min
- 9Calibration against estimationGraduate2 min
- 10Sufficient statisticsGraduate2 min
- 11Validation: predict the experimentGraduate2 min
- 12Bounds instead of pointsResearch2 min
- 13The Dials: how averse to risk?Graduate2 min
- 14In practice: estimation as a jobPractice2 min
- 15Frontier: learned estimatorsGraduate2 min
- Recap, problems, and the road aheadAll tracks3 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.
The railway forecastPrinciples and the major3 min
In the early 1970s the San Francisco Bay Area was building a railway, BART, and planners had to say how many people would ride it. The official forecast, from a model of the trips between zones of the map, said about fifteen percent of work trips. Daniel McFadden tried something else. Before a single train ran, he took a survey of commuters: how long each trip took by car and by bus, what it cost, and what each person chose. From those choices he estimated how much a minute and a dollar mattered to them, and used that to forecast a choice they had never had. His model said 6.3 percent. When BART was running, in 1975, it carried 6.2 percent. McFadden went back to the same travellers to check.
That is what this part is about. Start with choices people actually made. Write a model in which those choices come from hidden quantities: what a minute, a dollar, the future or a risk is worth to them. Find the values of those quantities that make the model's predictions match the choices, and say how sure you are. Then ask the model about a world nobody has seen: a new railway, a new tax, a new pension. It works only if the hidden quantities stay put when the world changes, and only if the data really pin them down. Both of those can fail, and this part shows how to tell.
The question: how is a model's hidden machinery measured from the choices it predicts? What makes a model's parameters worth measuring at all? How are they measured: by likelihood, by moments, by simulation? What in the data pins down which parameter? And how would we know if the answer were wrong?
Economics, Built. Part fifty-four: estimating models. By the end of this part you will be able to say what makes a model structural, and why a forecast of a new policy needs one; how maximum likelihood, the generalized method of moments and simulation estimate its parameters, with standard errors; which facts in the data pin down which parameters, and how to check; where calibration, sufficient statistics, validation against experiments and bounds fit in; and you will have watched all of it done on the Island, where the truth is known, so every estimate can be graded.
What it does: BART: the official forecast, McFadden's, and what happened; the question; objectives
1What "structural" meansPrinciples and the major2 min
Economists use the word structural a great deal. Jacob Marschak gave it its meaning in 1953: to predict the effect of a policy that has never been tried, you must measure the things the policy will not change. A reduced-form forecast takes a history, finds a pattern in it, and extends the pattern. That is fine while the world stays as it was. A structural forecast goes from choices to what produced them, preferences and constraints, and then asks how the same people, with the same preferences, would choose under the new policy. Robert Lucas's critique, from Part twenty-eight, is the warning: a pattern fitted under one policy can break under another, because the pattern was itself a response to the old policy.
Here is the difference on the Island, where we know the truth. For twelve years the price of fuel moved the cost of a car trip up and down by a dollar or so, and each year a share of the Island's three thousand commuters drove. A straight line fits that history well: each extra dollar, about ten points fewer drivers. Now the town proposes a congestion charge of 8 dollars a trip, far outside anything in the history. The line says minus 33 percent of commuters would drive: fewer than none. The logit we will estimate in the next chapter models each commuter's choice, so the share can never fall below zero; as the charge rises, fewer and fewer drivers are left to lose. It says 2.1 percent. The truth is 2.7 percent. The line was not wrong about the past. It was never a model of why people drive, so it had nothing to say about a world it had not seen.
What it does: Reduced form and structure; a line through history asked about a congestion charge
2Random utility and maximum likelihoodPrinciples and the major5 min
McFadden's model starts from a person, not a zone. Commuter i gets some utility from each way of getting to work. Part of it we can see: the minutes and the dollars, weighted by how much each matters, and a constant for what the option is like. Part of it we cannot: the weather that morning, a dislike of buses, a bag to carry. Each commuter takes whichever option gives more. If the unseen parts are independent draws from the extreme-value distribution, the chance of taking the bus has this simple form, a logistic curve in the difference between the two options' visible utilities. That is the logit. Now turn it round. For any guess at the weights, the model gives each commuter a probability of doing what they actually did. Multiply those together over everyone, or add the logarithms, and you have the likelihood. Maximum likelihood takes the weights that make the choices people actually made most probable.
The Island has 3,000 commuters, each with a car trip and a bus trip of different lengths and costs. Group them by how much better the bus looks, under the fitted model, and plot the share in each group who took it. The logit's curve runs through them. Where the bus looks much worse, almost nobody takes it, but not quite nobody: the unseen part of utility means some people always surprise us. That is what the model's randomness is for.
Here is the log likelihood as a landscape over the two weights, with the constant held at its estimate. Bright is high. The top is a narrow ridge: people's choices say clearly how minutes trade against dollars, and a little less clearly how much both matter. Newton's method climbs it from zero by fitting a bowl to the surface where it stands and jumping to the bowl's top. It arrives in 5 steps. The white cross is the truth we planted; the gold dot is the estimate. And the curvature at the top gives the uncertainty: a sharp peak means the data pin the parameters down, a flat one means they do not. Its inverse is the estimate's variance, Fisher's information at work.
The estimates. Each lies within one and a half standard errors of the value we planted. The number transport planners most want is a ratio: how many dollars a commuter will pay to save an hour, sixty times the weight on a minute over the weight on a dollar. The estimate is 6 dollars 96 an hour, give or take 0.41, against 7 dollars 20 planted. That is a price nobody ever posted, read off the choices people made. It is the number that goes into every appraisal of a new road or railway.
Now the reason for all this: a forecast. The Island opens a railway, 35 minutes and 2 dollars 50 for everyone. Before it, the commuters split between car and bus. The logit, given the railway's time and fare and its constant, forecasts that rail takes 44 percent of commuters. In fact it takes 43 percent, close. But look where its riders come from. The logit says 58 percent of them leave the bus and the rest leave their cars; in truth 67 percent leave the bus, and 30 percent still drive, not 25 percent. The logit's hidden assumption is that a new option draws from the old ones in proportion to their shares, because the unseen parts of utility are independent. On the Island, people who dislike the car's alternatives dislike both of them: rail and bus are close substitutes. McFadden's nested logit of 1978 lets the unseen parts be correlated within a nest. A forecast of traffic on the roads depends on getting that right.
What it does: The logit; its curve; the likelihood surface; the value of time; a railway
3Play it: which fact pins down which parameter?Graduate3 min
Your turn. The Island's households work for forty years on risky incomes, then live ten more on a pension. Two hidden numbers drive their saving. Patience, beta: how much the future counts against the present. And caution, gamma: how much they dislike risk. Both make people save more, so both raise wealth. You can measure four facts about them: wealth just before retirement, wealth in the last years, how fast consumption grows while they are young, and how it changes at retirement. Which fact tells patience apart from caution? Pause, and choose.
Here is how each fact moves. The first column: what a little more patience, one hundredth on beta, does to each fact. The second: what one more unit of caution does. Now compare them, row by row. They are almost the same. On every one of the four facts, one more unit of caution does what about one hundredth more patience does. So the answer is the last: none of them, on its own or together, separates the two. They all move along the same line, and any pair of values along that line explains them almost equally well.
Draw it. Each line holds one fact fixed at its value in the data: every combination of patience and caution on it reproduces that fact. All four lines lie almost on top of each other. Put the four facts together, weight them well, and the region the data allow is this long thin sliver along the lines: patience is pinned to within a few thousandths, caution only to within about a unit either way, and the two errors move together. This is identification, the subject of Chapter 8. To tell two parameters apart you need variation in the data that moves one and not the other. Caution matters only where there is risk, so households facing more or less income risk would separate them; so would different interest rates. Pierre-Olivier Gourinchas and Jonathan Parker used the shape of the whole life-cycle profile; Isaiah Andrews, Matthew Gentzkow and Jesse Shapiro gave us a way to see which facts an estimate leans on.
What it does: Four facts, two parameters; the lines that coincide
4The generalized method of momentsGraduate4 min
Maximum likelihood needs the whole probability model. Often an economic model tells you less, but something sharp: some quantity should be zero on average. Write those as moment conditions: functions of the data and the parameters whose expectation is zero at the true parameters. Lars Peter Hansen's generalized method of moments, of 1982, takes the sample averages of the conditions and chooses the parameters that make them as close to zero as possible, measured with a weighting matrix W. With more conditions than parameters, they cannot all be zero exactly, and the weighting matters. The best weights are the inverse of the conditions' covariance: noisy conditions count less, and conditions that move together are not counted twice. The variance of the estimate follows from how fast the conditions respond to the parameters. And because the extra conditions are over-identifying, the minimized objective is itself a test, Hansen's J: if the model is right, it is roughly chi-squared, with as many degrees of freedom as extra conditions.
The most famous use is Hansen and Kenneth Singleton's, from the same year. A household that can save in an asset gives up a unit of consumption today only if it expects the return, valued in tomorrow's marginal utility and discounted, to repay exactly one unit. That is Part twenty-three's Euler equation. Multiply it by anything the household knew at the time, and the average must still be zero: each instrument gives a moment condition. On the Island we have 2,000 periods of consumption growth and returns on two assets, a bond-like one and a risky one; with a constant and last period's values as instruments, that is eight conditions for two parameters. Here is the GMM objective over patience and risk aversion, bright where it is small. The estimates: beta 0.969, risk aversion 2.90, against 0.97 and 3 planted. Notice what we did not do: we never solved for the household's consumption rule, or said what its income process was. The Euler equation alone was enough. Notice, too, the long bright ridge: more patience and more risk aversion can stand in for each other, and the two estimates are strongly correlated. We met that ridge in the Play it, and we will meet it again.
Now the test. With two assets there are six more conditions than parameters, so if the model is right, J should look like a draw from the green curve. It is 11.3, below the five percent line: the model is not rejected. Now add a third asset whose return is 1 percentage point a period higher than the model can explain: a premium the household's Euler equation does not price. There are now thirteen extra conditions, and J jumps to 67, far beyond the red line. The model is rejected. Two cautions. A rejection says the conditions cannot all hold at once; it does not say which one fails. And when Hansen and Singleton took the model to American stock returns, several of their specifications were rejected, an early sign of the trouble Part twenty-three called the equity premium puzzle.
What it does: Moment conditions; Euler equations; the J-test
5When the likelihood has no formulaGraduate3 min
The logit had a formula for each choice's probability. Most realistic models do not. Let tastes vary from person to person, or let today's choice depend on expectations about tomorrow, and the probability of what someone did becomes an integral nobody can write down. But you can still simulate the model. In 1989 Daniel McFadden, and separately Ariel Pakes and David Pollard, showed how to estimate with simulations. Guess the parameters. Simulate the model several times, S data sets as large as the real one. Compute their moments, compare them with the data's, and adjust the guess until they match: the method of simulated moments. Two rules. Use the same random draws at every guess, or the objective jumps about and no optimizer can climb it. And pay for the simulation in precision: with S simulated data sets, the variance of the estimate is multiplied by one plus one over S. This is the workhorse behind random-coefficient demand in Part forty-three, dynamic choice in Part forty-four, and the life cycle in the next chapter.
Indirect inference, from Christian Gouriéroux, Alain Monfort and Éric Renault, and from Anthony Smith, goes one step further. Take a moving average: each period's value is a fresh shock plus theta times the last one. It is trivial to simulate, but its likelihood is awkward to write. So look at the data through a lens that is easy to fit: a regression of each value on its three predecessors, by least squares. The lens is the wrong model, and that does not matter. Choose theta so that the same lens, fitted to data simulated from the model, sees the same coefficients. In this sample of 200 periods, indirect inference gives 0.59; the simplest method, inverting the first autocorrelation, gives 0.66. The truth is 0.5.
One sample proves nothing, so repeat it 300 times. Here is the spread of the simple estimate across samples: centred on the truth, but wide, with a typical error of 0.13. And indirect inference: centred on the truth too, and about half as wide, a typical error of 0.07. The first autocorrelation uses one feature of the data; the lens uses three, and the simulations translate them back into the parameter. Choosing a good lens is choosing which features of the data the estimate listens to, the same question the Play it asked.
What it does: Simulated moments; indirect inference; 300 samples
6The Island's households, estimatedGraduate3 min
Now a full example, done the way Pierre-Olivier Gourinchas and Jonathan Parker did it for American households in 2002, but on the Island, where we planted the answer. The household is Part twenty-two's: it works from twenty to fifty-nine on a risky income, then lives on a pension to sixty-nine. Each year it chooses how much to consume, saves the rest at three percent, and cannot borrow. Two numbers are hidden: patience and caution. The data are 3,000 households' average consumption at ten ages and their wealth at six: sixteen moments. For each guess at the two numbers, the computer solves the household's problem backwards from the last year, simulates 5 populations with fixed draws, and compares their moments with the data's.
Here is what is being matched. On the left, consumption by age: it rises through the working years as incomes grow and the households build a buffer, peaks in the late thirties, and falls as the impatient households spend down. On the right, wealth: almost nothing at forty, a hump that peaks just before retirement, then run down through the pension years. The purple lines are the model at the estimated values. They pass through every point: sixteen facts matched with two numbers.
The search started far away, at patience 0.93 and caution 3. After 138 guesses, each one a solved and simulated economy, it stopped at patience 0.9505 and caution 1.95, against 0.95 and 2 planted: each within about one and a quarter standard errors of the truth. The J statistic, 6.4 on 14 degrees of freedom, says the model fits, as it should: it is the model that made the data. And here is the warning from the Play it, in one number. The two estimates' correlation is minus 0.9999. The sixteen facts pin down a line of patience-and-caution pairs very precisely; what picks a point on the line is the subtle curvature of the profiles. With real data, where the model is never exactly right, that is a thin thread to hang a number on.
What it does: Sixteen moments; the fit; the truth recovered on a ridge
Intermission: America's driving, 1971-2026Principles and the major
This chapter has no narration to read.
7Dynamic choices and hidden typesGraduate3 min
When today's choice changes tomorrow's options, the model has to look ahead, and so does the estimator. For each guess at the parameters, solve the dynamic problem for the value of each choice in each state, turn the values into choice probabilities, and evaluate the likelihood of what people did. That is John Rust's nested fixed point, which estimated the bus engines of Part forty-four. Joseph Hotz and Robert Miller found a shortcut: read the values off the observed frequency of each choice, and skip most of the solving. And Michael Keane and Kenneth Wolpin estimated young men's careers this way, with one more ingredient that turns out to matter enormously: a few hidden types of person.
Here is why. The Island follows 800 commuters for 8 weeks. Each week each of them takes the bus or not, depending on how the trip looks that week. The bars count people by how many weeks they took the bus. We planted two kinds of people: 40 percent who dislike the bus, in pink, and the rest, who like it, in green. The data do not say who is which. And we planted no habit at all: last week's choice has no effect on this week's.
Now estimate. Ignore the types, and fit one logit to everybody. The response to how the trip looks comes out at 0.63, too small: the hidden differences between people add noise that flattens it. Worse, add last week's choice as a regressor, and it comes out at 1.16, more than twenty standard errors from zero: a strong habit that does not exist. People who took the bus last week are mostly the people who like the bus. James Heckman called this spurious state dependence. Now let there be two hidden types, and estimate their share and their constants along with everything else. The EM algorithm asks, person by person, how likely each type is given everything they did, refits, and repeats. It finds the response, 0.85, the share of bus-haters, 0.40, and a habit of 0.10: about zero. The difference matters. If riding builds a habit, a free week of buses is a good investment; if it does not, it is a gift to people who would have ridden anyway.
What it does: Nested fixed points; spurious habit; a mixture by EM
8IdentificationResearch3 min
Behind every estimate is a question that has nothing to do with sample size. A parameter is identified if, with unlimited data, only one value of it would fit. Tjalling Koopmans and the Cowles Commission put the question at the centre of econometrics from 1949. The Play it showed a weak case: four facts that leave a whole line of values almost equally good. Rust's buses showed another: the discount factor barely moves the likelihood. What identifies a parameter is variation in the data that moves its footprint and not the others'. And in practice the useful question is: which moments is this estimate leaning on? Isaiah Andrews, Matthew Gentzkow and Jesse Shapiro answered it with one matrix, built from the same pieces as the standard errors. It says how far each estimate moves when each moment moves a little.
Here it is for caution, in the Island's life-cycle estimate. Each bar is one of the sixteen facts: consumption at ten ages in blue, wealth at six in pink. Its height is how far the estimate of caution would move if that one fact in the data were one percent higher. The standard error of the estimate is 0.04. The bars are enormous by comparison, and they alternate in sign. One percent more wealth at sixty-five moves it by minus 5.7; one percent more wealth at sixty, by 3.5. The efficient estimate is reading tiny differences between facts that move almost together, the line from the Play it, and amplifying them.
So test it. Suppose the survey overstated every household's wealth by one percent, a tiny error by the standards of any real survey. Adding up the pink bars, the matrix predicts that caution's estimate moves by minus 1.45. Estimating the whole model again, it moves by minus 1.50: the matrix was right, and it took no new estimation to know. That shift is 38 standard errors. A standard error measures how much the estimate would vary with a new sample from the same world. It says nothing about an assumption that is slightly wrong. The sensitivity matrix shows which assumptions matter, and a careful paper reports it beside the estimates.
What it does: The sensitivity matrix; a 1% error in wealth
9Calibration against estimationGraduate2 min
When Finn Kydland and Edward Prescott built the first real business cycle model in 1982, they did not estimate it. They calibrated it: each parameter was taken from other evidence, a long-run average or a study of households, and the model was then judged on things it had not been built to match, like how much consumption moves over the cycle. Lars Peter Hansen and James Heckman replied, in the same journal issue of 1996, that borrowed numbers come from other models and other populations, and that a model whose parameters are never confronted with the data cannot be told it is wrong. The modern practice is a compromise: calibrate what is well measured elsewhere and estimate the rest, or let the outside evidence enter as a prior, as the Bayesian estimation of central banks' models does. On the Island we can see what the choice costs.
Suppose we calibrate caution, taking it from the Dial of relative risk aversion, and estimate only patience. The left panel is the best patience for each calibrated caution. They trade off along the ridge: calibrate caution at one, as studies of consumption and labour supply suggest, and patience comes out at 0.961; calibrate it at four, from surveys of gambles over lifetime income, and patience is 0.927. The borrowed number decides the estimated one. But the data are not silent. The right panel is how badly each pair fits, on a log scale. Only near caution two does the fit pass the test: at one the J statistic is 529, at four 2417, against 8 at two. So calibration hides nothing if you also report the fit; it misleads when the borrowed number is simply assumed, and the profiles the model was meant to explain are never looked at again.
What it does: The debate; borrowed caution and estimated patience
10Sufficient statisticsGraduate2 min
Structural estimation asks a lot: every primitive of the model, measured. Raj Chetty pointed to a shortcut. For many policy questions, the welfare effect of a small change depends only on a few numbers that can be measured directly. Part forty-two's formula for unemployment insurance is the example: a slightly higher benefit is worth it if the gain, the drop in consumption when people lose their jobs valued in marginal utility, exceeds the cost, the elasticity of unemployment to the benefit. The formula holds in any model that produces those two numbers, whatever the details of search, saving or borrowing. Chetty called these sufficient statistics: a bridge between structural logic and reduced-form evidence.
Check it on Part forty-two's model, where we know everything. On top, welfare computed from the whole model, for every benefit level. Below, the formula, computed at each benefit from just the two numbers an economist could measure there. They agree: the formula crosses zero exactly where welfare peaks, at 33 percent of the wage. Nothing else about the model was needed.
What it cannot do. Suppose the one experiment we have was run at a benefit of 20 percent of the wage, and measured an elasticity of 0.18. To find the best benefit, the formula needs the elasticity at other benefits too. Assume it is the same everywhere, and the formula puts the best benefit at 50 percent, against 33 in truth. In the model, the elasticity rises steeply as benefits rise: the closer the benefit comes to the wage, the larger the share of what a job adds that each further rise takes away. Sufficient statistics answer local questions without a model; for a change far from the data, you need to know how the statistics themselves would move, and that is a model again.
What it does: The formula against the model; one elasticity extrapolated
11Validation: predict the experimentGraduate2 min
How would we know if a structural model were wrong? The strongest test is to predict an experiment before looking at it. In 1997 Mexico began PROGRESA, which paid mothers when their children attended school, and started it first in villages chosen at random. Petra Todd and Kenneth Wolpin estimated a model of families' schooling choices using only the control villages, where there was no subsidy. How can data without a subsidy say what a subsidy does? Through wages. Children's wages differ from village to village, and a school subsidy works like a cut in the wage a child gives up by attending. If families treat a peso of subsidy like a peso of wages, the model can predict the subsidy's effect. They predicted the treated villages' schooling, then compared. The predictions were broadly close to what the experiment found. And once validated, the model could answer what the experiment could not, like how a different schedule of payments by age would have done.
The Island runs the same test. 200 villages of 60 children; half, chosen at random, get a subsidy for attendance. A schooling model estimated on the control villages alone, where children's wages vary, predicts that the subsidy raises attendance by 18.2 points. The experiment finds 18.1. Validated. Now a second world, identical except that parents respond to the subsidy more than to the same money in wages, because it is labelled for school, or because it comes with a condition attached. The model, estimated as before, still predicts 18.2 points. The experiment finds 30.3. The prediction fails, and its failure is informative: the assumption that a peso is a peso, which let wages stand in for a subsidy, is what broke. A model that passes such a test has earned some trust; one that has never faced one has not.
What it does: PROGRESA; the Island's subsidy, twice
12Bounds instead of pointsResearch2 min
Every method so far ended with a point and a standard error. Charles Manski asked what we know before we assume anything. Every point estimate rests on assumptions the data cannot check. So start with none, see what the data alone say, and add assumptions one at a time. The answer is an interval, the set of values consistent with the data and the assumptions made so far, and it narrows as the assumptions grow stronger. Manski called the trade-off the law of decreasing credibility: the stronger the assumptions, the sharper the answer and the less anyone should believe it.
Back to the Island's school experiment, with a complication: attendance records are missing for about 20 percent of children, and nobody knows why. With no assumption at all, a missing child might or might not attend, so the subsidized villages' attendance lies between 53 percent and 72 percent, and the control villages' between 37 percent and 59 percent. So the effect lies between minus 6 percent and 35 percent: the data alone cannot even say the subsidy helped. Add one assumption most people would accept: the children with missing records attend no more often than those with records, since registers tend to lose the dropouts. Now the effect lies between 5 percent and 28 percent: positive. The usual analysis assumes the records are missing at random and reports a single number, 18 percent. It happens to be close to the truth here, but its attendance rates are not: they are several points too high, because the missing are mostly the dropouts. The white ticks are the truth, inside every interval that only assumed what was true.
What it does: Manski's intervals with and without an assumption
13The Dials: how averse to risk?Graduate2 min
Chapter nine borrowed a number from the Dial of relative risk aversion. Here is the Dial. Laboratory gambles over a few dollars give a fraction of one. Consumption and labour supply give about one. Finance's Euler equations give two to seven. Surveys of gambles over lifetime income give four. The calibrations that fit asset prices need ten or more. The status is contested, and after this part we can say why.
Each method leans on different facts, exactly as the sensitivity matrix showed for one estimate. The laboratory uses small gambles, where any smooth utility function should be nearly indifferent to risk, so whatever aversion people show there cannot be the curvature of utility over wealth, which is Matthew Rabin's point from Part seven. Labour supply and consumption use how hours and spending respond to wages and windfalls. Finance uses how returns move with consumption. Surveys use gambles over a lifetime's income that nobody is actually offered. Put one parameter, gamma, into a model that is not quite right, and each set of facts asks for its own value. It is the J-test's rejection from Chapter four, at the scale of a whole field: the conditions cannot all hold with a single number.
The other dial this part speaks to has a status of its own. When Part forty-four estimated Rust's buses, the likelihood barely moved among patient discount factors: it could rule out myopia, and little else. Not identified is a status a dial can have, and an honest one. The usual practice is to fix the discount factor by assumption and say so, which is calibration, chosen because estimation could not do better.
What it does: Risk aversion by method; the discount factor, not identified
14In practice: estimation as a jobPractice2 min
Where is this done for a living? In transport ministries, where the value of time from logit models like McFadden's decides which roads and railways get built. At competition authorities, which estimate demand and then simulate what a merger would do to prices, as in Part forty-three. At central banks, whose models of the whole economy are estimated, since Frank Smets and Rafael Wouters, with Bayesian methods: the outside evidence enters as priors, the compromise from Chapter nine. At firms, whose pricing teams estimate demand from prices that vary, or that they vary on purpose. And sometimes all of these at once: Peter Cohen and coauthors used the jumps in Uber's surge prices to trace out demand for rides, and estimated that in 2015 UberX gave its riders about two point nine billion dollars of consumer surplus in four American cities.
Called it? A forecast with more data than any in this part, and no model. In 2008 Google's engineers, writing in Nature, showed that the share of searches for terms like flu symptoms tracked the share of doctor visits for flu-like illness, and could estimate it a week or two before the government's surveillance reports. The basis was a correlation fitted to past years, with no account of why people search. It worked, for a while. Its first version missed the 2009 pandemic, which arrived out of season. And in the 2012 to 2013 season it estimated about twice the doctor visits the Centers for Disease Control recorded; three-week-old official data forecast the present better. The verdict: partly right. David Lazer and colleagues traced much of the failure to changes in the search engine itself: the pattern was a product of conditions that changed. It is Chapter one's straight line, with a billion data points: the Lucas critique does not care how big the data are.
What it does: Where models are estimated; Called it? (partly right)
15Frontier: learned estimatorsGraduate2 min
Simulated moments search for the parameters anew for every data set. The frontier turns that around. Draw a parameter at random, simulate a data set from the model, summarize it, and do this thousands of times. Then learn the map from summaries back to the parameter that produced them: with a regression here, with a neural network at scale. For the moving average, after 3,000 simulated samples, the learned map estimates 300 fresh ones with a typical error of 0.06, and each estimate takes no search at all. Kyle Cranmer, Johann Brehmer and Gilles Louppe call the family simulation-based inference; it learns whole posterior distributions, not just points, and economists have begun to use it for structural models whose simulations are too slow to search through.
What remains open. Learned estimators are fast but approximate, and their errors have to be checked against known truths, which is what a simulated world like the Island is for. Machine learning is moving inside estimation: flexible models for the parts of a problem we do not care about, with the structural parameter kept in view. Models and experiments are being combined: estimate on one arm and predict the other, as Todd and Wolpin did, or let an experiment pin down the parameter the observational data cannot. And John Horton and others have asked language models to answer surveys and play economic games, as simulated people. Whether their answers say anything about real people's parameters is, so far, a question for validation, not an answer.
What it does: Simulation-based inference; open questions
Recap, problems, and the road aheadAll tracks3 min
So: how is a model's hidden machinery measured from the choices it predicts? By writing down how the choices would follow from the hidden parameters, and finding the values under which the model reproduces what people actually did: by likelihood when the model gives probabilities, by moments when it gives only averages, and by simulation when it gives neither. Then by asking three more questions, which matter as much as the estimate: what in the data pins each value down; how far the answer leans on assumptions the data cannot check; and whether the model predicts what it was never shown.
Part fifty-four in twelve lines. A structural model knows why people choose, so it can be asked about a world nobody has seen; a pattern fitted to history cannot. Random utility with extreme-value errors gives the logit, and maximum likelihood reads the value of time off people's choices. The logit's independence makes a new option draw too evenly from the old ones; nests fix it. Two parameters that move every fact alike cannot be told apart by those facts. The generalized method of moments estimates from conditions alone, and its J-test catches a condition that fails. Simulation estimates what has no formula, with fixed draws and a small price in precision. The Island's households were estimated, and the truth recovered, along a very narrow ridge. Ignore who people are, and a habit appears from nowhere. A one-percent error in the data can move an estimate by dozens of standard errors, and the sensitivity matrix shows where. Calibration borrows a number, and the borrowed number decides the rest. Sufficient statistics answer nearby questions without a model, and far-away ones wrongly. And the best tests are an experiment the model never saw, and the bounds the data allow before we assume anything.
The problems. Derive the logit; price an hour and its uncertainty; the red bus and the blue bus; GMM as two-stage least squares; reading a J statistic; why simulations need fixed draws; a habit made of types; and a starred problem on the width of Manski's bounds. Full solutions are in the part's notes.
The reading: Kenneth Train's book on discrete choice and simulation; Fumio Hayashi's chapters on the generalized method of moments; Hamish Low and Costas Meghir on what structural models are for; and Charles Manski on partial identification. Then the papers, from Marschak to the frontier.
Next time, the hardest identification problem in economics. In 1992 Christopher Sims ran careful vector autoregressions for five countries and found that after a central bank raised its rate, prices rose. It is called the price puzzle, and it is what identification failing looks like: the bank raised rates because it saw inflation coming. Part fifty-five is about identifying macroeconomic effects with one history and no control group: vector autoregressions, narrative shocks, surprises measured in minutes, and the Island's own history, where the true effect is known, to grade them.
Where it goes next. Part 55 turns from people's choices to an economy's one history: identifying the effects of monetary and fiscal policy.
Key results
The part's results in one place, for revision.
Try it
Lab 54 · Estimating models
Estimate the hidden parameters of the Island's models from the choices they produce, with standard errors and tests, and check the estimates against the truth that was planted.
python -m videos.economics.labs 54
needs numpy, scipy, matplotlib · download lab54.py ·
source on GitHublogit: minute, dollar, bus constant (standard errors) -0.062 (0.003), -0.536 (0.027), -0.437 (0.100)
value of an hour (planted $7.20) $6.96 (0.41)
railway: car, bus, rail, truth 0.298, 0.274, 0.429
railway: car, bus, rail, the logit's forecast 0.245, 0.316, 0.439
GMM: beta, gamma (planted 0.97, 3) 0.9689 (0.0021), 2.905 (0.109)
Hansen's J, degrees of freedom, p 11.34, 6, 0.079
MA(1), 100 samples: error of the naive and indirect-inference estimates 0.135, 0.069
habit (planted 0): one logit for everyone; two hidden types 1.16; 0.10
validation (a peso is a peso): predicted, experimental (s.e.) 0.182, 0.181 (0.020)
validation (the label matters): predicted, experimental (s.e.) 0.182, 0.303 (0.019)
Manski's bounds on the effect, no assumption [-0.061, 0.347]
A model of why people choose can be asked about worlds nobody has seen; likelihood, moments and simulation estimate it; hidden types masquerade as habits; an experiment the model never saw is the strongest test, and bounds say what the data allow before any assumption.
The code (113 lines; it asserts its own result)
"""Lab 54: estimating models: a logit by maximum likelihood and the value of time, a railway forecast against a
nested-logit truth, GMM on the Euler equation with the J-test, indirect inference against the naive estimator, hidden
types and spurious habit, a subsidy experiment predicted from control villages, and Manski's bounds."""
import numpy as np
from videos.coursekit import labs
from explainer.economics.agora import estimate as E
from explainer.economics.island import truths
from explainer.stats.kit import quasi
TITLE = "Estimating models"
GOAL = ("Estimate the hidden parameters of the Island's models from the choices they produce, with standard errors and "
"tests, and check the estimates against the truth that was planted.")
TASKS = [
"Set the nest's lambda to 1 (no correlation between bus and rail). Is the logit's railway forecast now right?",
"Give the subsidy a label effect of 0.3 instead of 0.6. Does the prediction still fail at the 5% level?",
"Shorten the moving-average samples to 100 periods. Does indirect inference still beat the naive estimator?",
]
def run(seed=0):
lab = labs.Lab()
T = truths(54)
C = T["commuters"]
d = E.simulate_commuters(C["n"], C["beta"], C["asc"], C["seed"])
r = E.logit_ml(d["X"], d["y"])
b, cov = r["b"], r["cov"]
vot = 60 * b[0] / b[1]
grad = np.array([60 / b[1], -60 * b[0] / b[1] ** 2])
lab.row("logit: minute, dollar, bus constant (standard errors)",
", ".join(f"{x:.3f} ({s:.3f})" for x, s in zip(b, r["se"])))
lab.row("value of an hour (planted $7.20)", f"${vot:.2f} ({np.sqrt(grad @ cov[:2, :2] @ grad):.2f})")
assert np.all(np.abs(b - np.array(list(C["beta"]) + [C["asc"][1]])) < 3 * r["se"])
rail = C["rail"]
n = d["X"].shape[0]
Xr = np.concatenate([d["X"], np.tile([[[rail["time"], rail["cost"]]]], (n, 1, 1))], axis=1)
V = Xr @ np.array(C["beta"]) + np.array([C["asc"][0], C["asc"][1], rail["asc"]])[None, :]
truth = E.nested_shares(V, [[0], [1, 2]], [1.0, C["nest_lambda"]]).mean(axis=0)
Vh = Xr @ b[:2] + np.array([0.0, b[2], rail["asc"]])[None, :]
fc = E.nested_shares(Vh, [[0], [1, 2]], [1.0, 1.0]).mean(axis=0)
lab.row("railway: car, bus, rail, truth", ", ".join(f"{x:.3f}" for x in truth))
lab.row("railway: car, bus, rail, the logit's forecast", ", ".join(f"{x:.3f}" for x in fc))
G = T["euler"]
data = E.euler_data(T=G["T"], beta=G["beta"], gamma=G["gamma"], seed=G["seed"])
g = E.gmm(E.euler_moments(data), [0.95, 2.0])
lab.row("GMM: beta, gamma (planted 0.97, 3)", f"{g['theta'][0]:.4f} ({g['se'][0]:.4f}), "
f"{g['theta'][1]:.3f} ({g['se'][1]:.3f})")
lab.row("Hansen's J, degrees of freedom, p", f"{g['J']:.2f}, {g['df']}, {g['p_J']:.3f}")
M = T["ma1"]
naive, ii = [], []
for k in range(100):
y = E.ma1_data(M["theta"], M["n"], 5400 + k + 1000 * seed)
o = E.indirect_ma1(y, seed=9000 + k)
naive.append(o["naive"])
ii.append(o["theta"])
rm = [float(np.sqrt(np.mean((np.array(a) - M["theta"]) ** 2))) for a in (naive, ii)]
lab.row("MA(1), 100 samples: error of the naive and indirect-inference estimates", f"{rm[0]:.3f}, {rm[1]:.3f}")
Ty = T["types"]
rng = np.random.default_rng(Ty["seed"])
P, nt = Ty["people"], Ty["T"] + 1
low = rng.random(P) < Ty["share_low"]
alpha = np.where(low, Ty["alpha"][0], Ty["alpha"][1])
grp = np.repeat(np.arange(P), nt)
x = rng.standard_normal(P * nt)
yy = (rng.random(P * nt) < 1 / (1 + np.exp(-(alpha[grp] + Ty["b"] * x)))).astype(float)
lag = np.roll(yy, 1)
keep = np.tile(np.arange(nt) > 0, P)
pooled = E.pooled_logit(np.column_stack([x[keep], lag[keep]]), yy[keep])
mix = E.mixture_logit_em(np.column_stack([x[keep], lag[keep]]), yy[keep], Ty["T"], grp[keep])
lab.row("habit (planted 0): one logit for everyone; two hidden types", f"{pooled['b'][2]:.2f}; {mix['b'][1]:.2f}")
S = T["school"]
for name, effect in (("a peso is a peso", 0.0), ("the label matters", S["label_effect"])):
v = E.validate_subsidy(E.school_villages(S["villages"], S["per"], subsidy=S["subsidy"], label_effect=effect,
seed=S["seed"]))
lab.row(f"validation ({name}): predicted, experimental (s.e.)",
f"{v['predicted_effect']:.3f}, {v['experimental_effect']:.3f} ({v['experimental_se']:.3f})")
dd = E.school_villages(S["villages"], S["per"], subsidy=S["subsidy"], seed=S["seed"])
rg = np.random.default_rng(S["seed"] + 2)
pm = np.where(dd["y"] > 0, 0.6 * S["missing"], 1.5 * S["missing"])
rec = rg.random(len(dd["y"])) >= pm
mb = quasi.manski(dd["y"], dd["treated"], rec, 0.0, 1.0)
lab.row("Manski's bounds on the effect, no assumption", f"[{mb['lo']:.3f}, {mb['hi']:.3f}]")
lab.note = ("A model of why people choose can be asked about worlds nobody has seen; likelihood, moments and "
"simulation estimate it; hidden types masquerade as habits; an experiment the model never saw is the "
"strongest test, and bounds say what the data allow before any assumption.")
fig, ax = labs.figure(2, size=(11, 4.4))
bins = np.linspace(-0.1, 1.0, 23)
ax[0].hist(naive, bins, color=labs.PURPLE, alpha=0.5, label="first autocorrelation")
ax[0].hist(ii, bins, color=labs.ORANGE, alpha=0.6, label="indirect inference")
ax[0].axvline(M["theta"], color="white")
ax[0].set(title="estimates of theta in 100 samples", xlabel="theta")
ax[0].legend()
dv = (d["X"][:, 1] - d["X"][:, 0]) @ b[:2] + b[2]
edges = np.quantile(dv, np.linspace(0, 1, 13))
mids = [dv[(dv >= lo) & (dv <= hi)].mean() for lo, hi in zip(edges[:-1], edges[1:])]
obs = [(d["y"][(dv >= lo) & (dv <= hi)] == 1).mean() for lo, hi in zip(edges[:-1], edges[1:])]
zs = np.linspace(edges[0], edges[-1], 100)
ax[1].plot(zs, 1 / (1 + np.exp(-zs)), color=labs.PURPLE, label="the fitted logit")
ax[1].plot(mids, obs, "o", color=labs.GREEN, label="commuters, in twelve groups")
ax[1].set(title="the logit's curve", xlabel="how much better the bus looks")
ax[1].legend()
lab.fig = fig
return lab
Now change it
- Set the nest's lambda to 1 (no correlation between bus and rail). Is the logit's railway forecast now right?
- Give the subsidy a label effect of 0.3 instead of 0.6. Does the prediction still fail at the 5% level?
- Shorten the moving-average samples to 100 periods. Does indirect inference still beat the naive estimator?
Problems, with solutions
Try each problem before opening its solution.
1. The logit: if the unseen parts of the utility of car and bus are independent extreme-value draws, show that the chance of the bus is e^V_bus / (e^V_car + e^V_bus).
Solution
With standard Gumbel errors, the difference of two independent draws has the logistic distribution, Pr(e_car - e_bus <= x) = 1/(1 + e^-x). The bus is chosen when V_bus + e_bus > V_car + e_car, that is when e_car - e_bus < V_bus - V_car, which has probability 1/(1 + e^-(V_bus - V_car)) = e^V_bus / (e^V_car + e^V_bus).
2. The value of time: with weights of -0.06 a minute and -0.5 a dollar, what is an hour worth? Give its standard error by the delta method.
Solution
A minute is worth 0.06/0.5 = $0.12, an hour 60 x 0.12 = $7.20. The value is v = 60 b_t / b_c, with gradient (60/b_c, -60 b_t / b_c^2); its variance is that gradient times the covariance of the two estimates times the gradient again. With the film's estimates and covariance it gives $6.96 with a standard error of 0.41.
3. The red bus and the blue bus: car and a red bus are chosen equally often; a blue bus identical to the red one is added. What does the logit predict, and what would you expect?
Solution
With equal utilities the logit gives each of the three options a third, so the car's share falls from 1/2 to 1/3. One would expect the blue bus to take only red-bus riders: car 1/2, each bus 1/4. The logit's independent errors treat the blue bus as a genuinely new option; a nested logit with the two buses in one nest and lambda near 0 gives the expected answer.
4. GMM: for y = x beta + u with instruments z, show that GMM with W = (Z'Z)^-1 is two-stage least squares.
Solution
The conditions are E[z(y - x beta)] = 0, with sample average g = Z'(y - X b)/n. Minimizing g'Wg gives the first-order condition X'Z W Z'(y - X b) = 0, so b = (X'Z W Z'X)^-1 X'Z W Z'y. With W = (Z'Z)^-1 this is (X'P X)^-1 X'P y with P = Z(Z'Z)^-1 Z', which is two-stage least squares.
5. Hansen's J: with eight conditions and two parameters, J = 11.3. Is the model rejected at 5%? At 10%?
Solution
There are 8 - 2 = 6 degrees of freedom. The chi-squared critical values are 12.59 at 5% and 10.64 at 10%, so the model is not rejected at 5% but is at 10% (p = 0.08), as in the film.
6. Simulated moments: why must the random draws be the same at every guess? By how much does S = 5 inflate the variance?
Solution
With fresh draws the simulated moments change between two guesses even when the parameters barely do, so the objective is not a smooth function of the parameters and an optimizer cannot climb it; fixing the draws makes it smooth. The simulated moments average S samples, so their noise adds 1/S of the data's sampling variance: the estimate's variance is (1 + 1/S) times that of the infeasible estimator with exact moments, 1.2 for S = 5.
7. Spurious habit: with two types and no habit, show that Pr(y_t = 1 | y_t-1 = 1) > Pr(y_t = 1 | y_t-1 = 0).
Solution
Let the types have chances p_H > p_L of choosing 1 each period, independently over time, and shares s and 1 - s. Then Pr(y_t = 1 | y_t-1 = 1) = (s p_H^2 + (1 - s) p_L^2)/(s p_H + (1 - s) p_L), the average of p weighted by p, which exceeds the average of p weighted by 1 - p, Pr(y_t = 1 | y_t-1 = 0). Last period's choice says which type someone probably is; it changes nothing about them.
8. Manski: outcomes lie in [0, 1] and shares p_1 and p_0 of the two arms are missing. Show that the no-assumption bound on the effect has width p_1 + p_0.
Solution
In arm a the mean lies between (1 - p_a) m_a and (1 - p_a) m_a + p_a, where m_a is the observed mean: an interval of width p_a. The effect's lower bound is the treated arm's lowest mean minus the control arm's highest, the upper bound the reverse, so its width is p_1 + p_0: about 0.41 in the film, with a fifth of records missing in each arm.
Notes and sources
Sources
The studies the film states are listed with what each shows in dials.SHOWN[54]; the risk-aversion and discount-factor
dials are in explainer/economics/dials.py; Google Flu Trends is a Called it? entry (explainer/economics/calls.py),
and BART is Part 5's; the vehicle miles are in the Data Room. Checked on 2026-11-21: Todd and Wolpin's design and
finding (estimation on the control villages, predictions that track the experimental impacts, and a better subsidy
schedule at similar cost), stated without numbers; Lazer and colleagues' account of Google Flu Trends (about twice the
CDC's figure in the 2012-13 season, three-week-old CDC data doing better); Cohen and coauthors' estimate of UberX's
consumer surplus in four cities in 2015. Gourinchas and Parker's own estimates are not shown, since their published
point estimates could not be checked here; the film uses their method only. The models are stated from the papers cited
in the chapters (Koopmans 1949, Marschak 1953, McFadden 1974 and 1989, Lucas 1976, Baily 1978, Heckman 1981, Hansen
1982, Hansen and Singleton 1982, Kydland and Prescott 1982 and 1996, Heckman and Singer 1984, Rust 1987, Pakes and
Pollard 1989, Manski 1990, Gouriéroux, Monfort and Renault 1993, Hotz and Miller 1993, Smith 1993, Hansen and Heckman
1996, Keane and Wolpin 1997, Gourinchas and Parker 2002, Todd and Wolpin 2006, Smets and Wouters 2007, Chetty 2009,
Andrews, Gentzkow and Shapiro 2017, Cranmer, Brehmer and Louppe 2020, Horton 2023) and computed here.
About this partfrom its README
Part 54 of a sixty-eight-part course in economics (see the series plan and the syllabus), the fourth of Act X, The Graduate Core. It asks how a model's hidden machinery is measured from the choices it predicts. Its answer: by writing down how the choices would follow from the hidden parameters, and finding the values under which the model reproduces what people did, by likelihood when the model gives probabilities, by moments when it gives only averages, and by simulation when it gives neither; then by asking what in the data pins each value down, how far the answer leans on assumptions the data cannot check, and whether the model predicts what it was never shown.
It opens on the Bay Area's new railway: the official forecast said about 15% of work trips would use BART; Daniel McFadden's model, estimated from a survey of commuters' choices before a train ran, said 6.3%; in 1975 it was 6.2%. Everything after that is done on the Island, where the truth was planted, so every estimate can be graded:
- what structural means (Marschak, Lucas): twelve years of fuel prices and the share who drive; a straight line fits the history (each dollar, about ten points fewer drivers) and, asked about an $8 congestion charge, says -33% would drive; the logit says 2.1%, the truth 2.7%;
- random utility and maximum likelihood: the logit from extreme-value errors, its S-curve through 3,000 commuters' choices, the likelihood surface climbed by Newton's method in five steps, the estimates (-0.062 a minute, -0.536 a dollar, against -0.06 and -0.5) and the value of time, $6.96 an hour (standard error 0.41; planted $7.20); a railway forecast whose total is close (44% against 43%) but which draws riders from the car too often (the logit leaves 25% driving, the nested truth 30%), the independence of irrelevant alternatives and the nested logit;
- Play it: patience and caution both make the Island's households save; which of four facts (consumption growth while young, wealth before retirement, wealth in the last years, consumption's change at retirement) tells them apart? None: on every fact one more unit of caution does what about 0.011 more patience does, so the four lines of values that leave each fact unchanged lie almost on top of each other;
- the generalized method of moments (Hansen 1982) and Hansen and Singleton's Euler equation, estimated without solving the model on 2,000 periods of the Island's consumption growth and two assets' returns: beta 0.969 (0.002) and risk aversion 2.90 (0.11) against 0.97 and 3; J = 11.3 on 6 degrees of freedom, not rejected; an asset paying one point a period more than the model can price gives J = 67 on 13, rejected;
- simulation (McFadden 1989, Pakes and Pollard 1989): simulated moments with fixed draws and the (1 + 1/S) price; indirect inference (Gouriéroux, Monfort and Renault 1993) for a moving average through an autoregression, with half the error of the first-autocorrelation estimator in 300 samples (0.071 against 0.131);
- the Island's life-cycle households estimated by simulated moments after Gourinchas and Parker: sixteen moments of 3,000 households, 138 solved and simulated economies from a start of (0.93, 3), patience 0.9505 (0.0004) and caution 1.95 (0.04) against 0.95 and 2, J = 6.4 on 14, and a correlation between the two estimates of -0.9999;
- an intermission film of America's vehicle miles travelled over the past twelve months, 1971-2026 (1.1 trillion to 3.3), with its 2007 plateau and the pandemic's dip, as a line and a tune;
- dynamic choice (Rust, Hotz and Miller, Keane and Wolpin) and hidden types: 800 commuters for 8 weeks, two planted types and no habit; one logit for everybody finds a response of 0.63 (truth 0.8) and a habit of 1.16 (standard error 0.05) that does not exist, Heckman's spurious state dependence; a two-type mixture by EM finds 0.85, a share of 0.40 and a habit of 0.10;
- identification (Koopmans) and Andrews, Gentzkow and Shapiro's sensitivity matrix: how far caution's estimate moves if each of the sixteen facts were 1% higher (up to 5.7, against a standard error of 0.04); a survey that overstates wealth by 1% moves it by -1.45 as predicted and -1.50 when estimated again, 38 standard errors;
- calibration against estimation (Kydland and Prescott; Hansen and Heckman): fix caution from the Dial and estimate patience; caution 1 gives patience 0.961, caution 4 gives 0.927, and only near 2 does the fit pass the J-test (J = 529 at 1, 2,417 at 4, 7.7 at 2);
- sufficient statistics (Baily, Chetty): on Part 42's unemployment-insurance model, the formula built from the consumption drop and one elasticity crosses zero exactly where welfare peaks (33% of the wage); an analyst with one experiment at 20% who assumes the elasticity never changes puts the optimum at 50%;
- validation (Todd and Wolpin on PROGRESA): a schooling model estimated on control villages predicts a subsidy's effect of 18.2 points and the experiment finds 18.1; in a world where parents respond to what the money is for, the same model still predicts 18.2 and the experiment finds 30.3;
- bounds (Manski): with about a fifth of attendance records missing, the effect lies between -6% and 35% with no assumption, between 5% and 28% if the missing attend no more often than the rest; the truth, 18.1%, is inside both;
- the Dials: relative risk aversion, contested because each method leans on different facts, and the discount factor of Part 44's buses, not identified;
- in practice (transport appraisal, merger simulation, central banks' Bayesian models, pricing teams, UberX's consumer surplus) and Called it? on Google Flu Trends (partly right); a frontier of learned estimators (an MA(1) estimated from summaries with a typical error of 0.058 after 3,000 simulated samples) and open questions.
What is computed and built
Everything plotted is computed by compute.py with Agora's estimation harness (explainer.economics.agora.estimate),
the Island's Part 54 truths and, for sufficient statistics, Part 42's model (agora.insurance); the narration states
the cached numbers.
- Commuters. 3,000 commuters; car 15-45 minutes and $2-8, bus 25-70 minutes and $0.5-2.5; utility -0.06 a minute, -0.5 a dollar, a bus constant of -0.4, Gumbel errors. The logit by Newton's method from zero; its log likelihood on a 49 x 45 grid of the two weights with the constant at its estimate; the value of time by the delta method.
- History. Twelve years in which fuel moved a car trip's cost by -$1 to +$1.50; shares from the true logit with binomial sampling; a least-squares line; an $8 charge.
- Rail. 35 minutes and $2.50; the truth a nested logit with bus and rail in one nest (lambda 0.5) and a rail constant of -0.2; the forecast the estimated logit with that constant.
- Play it. The life-cycle model below at the truth; four summary moments from the households' bins; their derivatives by central differences with common random numbers; the 95% region from their efficient combination.
- GMM. Consumption growth an AR(1) (mean 2%, persistence 0.3, s.d. 2%); returns that satisfy the Euler equation exactly with beta 0.97 and gamma 3 plus noise (s.d. 3% and 12%); instruments a constant and the lagged growth and returns; two-step GMM with Nelder-Mead; a third asset with a premium of 1% a period.
- Indirect inference. MA(1) with theta 0.5; an AR(3) lens; 10 simulated paths; 300 samples of 200.
- Life cycle. 50 years (40 working with a hump-shaped income profile and a Rouwenhorst shock with persistence 0.95 and s.d. 0.15; 10 on a pension of 40% of last earnings), R = 1.03, no borrowing, solved by the endogenous grid method; 3,000 households; consumption in ten five-year bins and wealth in the last six; 5 simulated populations; efficient weights; the profile over 13 values of caution; the 1% wealth test estimated again.
- Types. 800 people, 9 weeks (the first used only as a lag), 40% with constant -1.5 and 60% with 1.0, response 0.8, no state dependence; pooled logits and two-type mixtures by EM.
- Sufficient statistics. Part 42's static model (gamma 2, A 3, theta 0.3856, kappa 11.81) on 59 benefits from 0.02 to 0.6.
- Validation and bounds. 200 villages of 60 children; wages $5-30; attendance a logit in a trait and the wage net of a $10 subsidy in a random half; a second world adding 0.6 for the subsidy's label; records missing with probability 0.12 for attenders and 0.3 for the rest.
- Learned estimator. 3,000 simulated MA(1) samples of 400 with theta uniform on (-0.9, 0.9); a cubic regression from the first three autocorrelations; 300 test samples.
Chapter notes
| # | Chapter | What it does |
|---|---|---|
| 0 | The railway forecast | BART: the official forecast, McFadden's, and what happened; the question; objectives |
| 1 | What "structural" means | Reduced form and structure; a line through history asked about a congestion charge |
| 2 | Random utility and maximum likelihood | The logit; its curve; the likelihood surface; the value of time; a railway |
| 3 | Play it: which fact pins down which parameter? | Four facts, two parameters; the lines that coincide |
| 4 | The generalized method of moments | Moment conditions; Euler equations; the J-test |
| 5 | When the likelihood has no formula | Simulated moments; indirect inference; 300 samples |
| 6 | The Island's households, estimated | Sixteen moments; the fit; the truth recovered on a ridge |
| — | Intermission | America's vehicle miles, 1971-2026, as a line and a tune; the story so far |
| 7 | Dynamic choices and hidden types | Nested fixed points; spurious habit; a mixture by EM |
| 8 | Identification | The sensitivity matrix; a 1% error in wealth |
| 9 | Calibration against estimation | The debate; borrowed caution and estimated patience |
| 10 | Sufficient statistics | The formula against the model; one elasticity extrapolated |
| 11 | Validation: predict the experiment | PROGRESA; the Island's subsidy, twice |
| 12 | Bounds instead of points | Manski's intervals with and without an assumption |
| 13 | The Dials: how averse to risk? | Risk aversion by method; the discount factor, not identified |
| 14 | In practice: estimation as a job | Where models are estimated; Called it? (partly right) |
| 15 | Frontier: learned estimators | Simulation-based inference; open questions |
| — | Outro | The answer; twelve lines; problems; reading; next, Part 55, Identifying Macro |
Notes
python -m videos.economics.labs 54: the commuters' logit and value of time; the railway forecast against the nested truth; GMM on the Euler equation with the J-test; indirect inference against the naive estimator; the hidden-types panel; the subsidy validation; Manski's bounds.- The interactive (course site): estimate. The reader is handed the Island's commuters with the truth hidden, adjusts the weights on minutes and dollars by hand to raise the likelihood, sees the value of time implied, and then reveals the truth and the maximum.
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Hook: the forecast; the question; objectives.
- What "structural" means: parameters that stay put when policy changes (Part 4's Lucas critique).
- Random utility and the logit derived from extreme-value errors (McFadden 1974); maximum likelihood.
- Play it: four moments and three parameters: which moment pins down which?
- The generalized method of moments (Hansen 1982) derived: the weighting matrix, efficiency, the J-test; Euler equations estimated without solving the model (Hansen and Singleton 1982).
- When the likelihood has no formula: simulation (McFadden 1989; Pakes and Pollard 1989); simulated moments; indirect inference (Gouriéroux, Monfort and Renault 1993).
- A full example on the Island: the life-cycle household of Part 22 estimated by simulated moments (Gourinchas and Parker 2002); the truth recovered, with standard errors.
- Dynamic discrete choice in general: Part 44's Rust model as the template; unobserved heterogeneity (Heckman and Singer 1984; Keane and Wolpin 1997).
- Identification: what variation moves which parameter; sensitivity of estimates to moments (Andrews, Gentzkow and Shapiro 2017).
- Calibration against estimation: the argument, and the modern compromise.
- Sufficient statistics (Chetty 2009): the welfare answer from two elasticities, without the model; what it cannot do.
- Validation: estimate before the experiment, predict the experiment (Todd and Wolpin 2006 on PROGRESA).
- Partial identification (Manski): bounds instead of points.
- Dials. 14. In practice: Parts 59–61; pricing and demand teams. 15. Frontier: estimation with machine learning inside (neural-network estimators; simulation-based inference).
Agora: estimate: one harness for ML, GMM, SMM and indirect inference with standard errors, a J-test and the
Andrews–Gentzkow–Shapiro sensitivity matrix; every Island model can be handed to it with its truth hidden.
Called it? McFadden's BART forecast; Todd and Wolpin's.
Reading: McFadden 1974, 1989; Hansen 1982; Hansen & Singleton 1982; Rust 1987; Keane & Wolpin 1997;
Gourinchas & Parker 2002; Chetty 2009; Andrews, Gentzkow & Shapiro 2017; Todd & Wolpin 2006; Train; Hayashi
chs 3–4, 7; Low & Meghir 2017; Wooldridge, Econometric Analysis of Cross Section and Panel Data; B. Hansen,
Econometrics.
Build the film
python -m videos.economics.econ54.compute # the part's numbers, into .cache/econ54
python tools/build.py econ54 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py econ54 Hook # one chapter, silent, with a contact sheet
Scenes: videos/economics/econ54. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.economics.econ54.compute # every number (about three minutes), into .cache/econ54/
python tools/qa_scene.py econ54 LifeCycle # one chapter, silent, at 480p, with a contact sheet
EXPLAINER_TTS=silent python tools/build.py econ54 -q l # the whole part, silent preview
python tools/build.py econ54 # 1080p30 with narration and the series' computed score
python -m videos.economics.labs 54 # the lab
The only data are the Federal Highway Administration's vehicle miles travelled, via FRED, registered in
SOURCES.md; every other number is computed.