← All analysis tools

Climate-smart agriculture in Zambia

Double Machine Learning

Predict the outcome, predict the choice, strip both out, and study what is left over.

Five rows of five blocks. In each row a different block is held out and outlined while the other four are filled, showing that the model predicting each slice was trained on the remaining four.

This comes at the problem from the opposite side to a switching regression. Instead of specifying shapes, you hand two prediction jobs to flexible algorithms.

One predicts a household’s income from its characteristics. The other predicts how likely that household was to adopt in the first place. Then you strip both predictions out and work on what is left over. The remainder is the part of income that neither the household’s circumstances nor its readiness to adopt can account for, and that is where the effect is estimated.

The safeguard worth knowing about

The sample is cut into five slices, and the prediction models used on each slice are trained on the other four. No household ever helps build the model that then predicts it.

Without that rule the model marks its own homework and the effect comes out far too clean. It is the difference between the method working and the method flattering itself.

What it cannot do

It buys freedom from functional form at a price: it assumes that once you account for everything you measured, adoption is as good as random. That assumption cannot be tested directly. It can only be bounded, which is what the robustness checks are for.

The equation

Y = Dθ0 + g0(X) + ε,    E[ ε | D, X ] = 0

Y
the outcome, income or yield
D
adopted or did not
θ0
the effect. The single number the whole exercise exists to find
g0(X)
everything else the household’s characteristics explain, of no fixed shape and learned from the data
E[ε | D, X] = 0
the assumption: once you know X, nothing systematic is left

Almost all the machinery sits inside g0. Traditional regression makes you guess its shape; here an algorithm learns it, so that θ0 is not quietly absorbing your guess.

Further reading

  • Chernozhukov, V. and others (2018). "Double/Debiased Machine Learning for Treatment and Structural Parameters", The Econometrics Journal. free Read it.The paper the method comes from, including why the sample has to be split.
  • Robinson, P. (1988). "Root-N-Consistent Semiparametric Regression", Econometrica. Read it.The partialling-out logic underneath it, thirty years earlier.

From the Zambia climate-smart agriculture research, built on the Water and Soil Accelerator household survey, which was funded by USAID. The thesis is under examination and the three papers drawn from it are under anonymous peer review, so there is nothing to link to yet.