Thursday, January 2, 2014

Massetti et al. - Part 3 of 3: Comparison of Degree Day Measures

Yesterday's blog entry outlined the differences between Massetti et al. derivation of degree days and our own.  To quickly recap: Our measure show much less variation within a county over the years, i.e., the standard deviation of fluctuations around the mean outcome in a county are about a third of theirs. One possibility is that our measure over-smoothes the year-to-year fluctuations, or alternatively, that Massetti et al.'s fluctuations might include measurement error, which would result in attenuation bias (paper).

Below are tests comparing various degree day measures in a panel of log corn and soybean yields. It seems preferable to test the predictive power in a panel setting as one does not have to worry about omitted variable bias (As mentioned before, Massetti et al. did not share their data with us and we hence can't match the same controls in a cross-sectional regression of farmland values). We use the optimal degree days bounds from earlier literature.

The following two tables regress log corn and soybean yields, respectively, for all counties east of the 100 degree meridian (except Florida) in 1979-2011 on four weather variables, state-specific restricted cubic splines with 3 knots, and county fixed effects. Column definitions are the same as in yesterday's post: Columns (1a)-(3b) use the NARR data to derive degree dats, while column (4b) uses our 2008 procedure. Columns (a) use the approach of Massetti et al. and derive the climate in a county as the inverse-distance weighted average of the four NARR grids surrounding a county centroid.  Columns (b) calculate degree days for each 2.5x2.5mile PRISM grid within a county (squared inverse-distance weighted average of all NARR grids over the US) and derives the county aggregate as the weighted average of all grids where the weight is proportional to the cropland area in a county. 

Columns (0a)-(0b) are added as baseline using a quadratic in growing season average temperature. Columns (1a)-(1b) follow Massetti et al. and first derive average daily temperatures and degree days using daily averages, i.e., degree days are only positive if the daily average exceeds the threshold. Columns (2a)-(2b) calculate degree days for each 3-hour reading. Degree days will be positive if part of the temperature distribution is above the threshold, but not the daily average.  Columns (3a)-(3b) approximate the temperature distribution within a day by linearly interpolating between the 3-hour measures.  Column (4b) uses a sinusoidal approximation between the daily minimum and maximum to approximate the temperature distribution within a day.

Explaining log corn yields 1979-2011.

Explaining log soybean yields 1979-2011.

The R-square is lowest for regressions using a quadratic in average temperature (0.37 for corn and 0.33 for soybeans).  It is slightly higher when we use degree days based on the NARR data set in columns (1a)-(3b), ranging from 0.39-0.41 for corn and 0.35-0.36 for soybeans.  It is much higher when our degree days measure is used in columns (4b): 0.51 for corn and 0.48 for soybeans.

The second row in the footer lists the percent reduction in root mean squared error (RMSE) compared to a model with no weather controls (just county fixed effects and state-specific time trends). Weather variables that add nothing would have 0%, while weather measures that explain all remaining variation would reduce the RMSE by 100%.  Column (4b) reduces the RMSE by twice as much as measures derived from NARR. Massetti et al.'s claim that they introduce "accurate measures of degree days" seems very odd given that their measure performs half as well as previously published measures that we shared with them.

The NARR data set likely includes more measurement error than our previous data set. Papers making comparisons between degree days and average temperature should use the best available degree days construction in order not to bias the test against the degree days model.

Correction (January 30th): An earlier version had a mistake in the code by calculating the RMSE both in and out-of-sample. The corrected version only calculates the RMSE out-of-sample.  While the reduction in RMSE increased for all columns, the relative comparison between models is not impacted.

Wednesday, January 1, 2014

Massetti et al. - Part 2 of 3: Calculation of Degree Days

Following up on yesterday's post, let's look at the differences in how to calculate degree days. Recall that degree days just count the number of degrees above a threshold and sum them over the growing season.  Massetti et al. argue in their abstract that "The paper shows that [...] hypotheses of the degree day literature fail when accurate measures of degree days are used." This claim is attributed to the fact that Massetti et al. supposedly use better data and hence get more accurate readings of degree days, however, no empirical evidence is provided. They use data from the North American Regional Reanalysis (NARR) that provides temperatures at 3-hour intervals. The authors proceed to first calculate average temperatures for each day from the eight readings per day, and then calculate degree days as the difference of the average temperature to the threshold.

Before we compare their method to calculating degree days to ours, a few words on the NARR data. Reanalysis data combine observational data with differential equations from physical models to interpolate data. For example, they utilize mass and energy balance, i.e., a certain amount of moisture can only fall once at precipitation.  If precipitation comes down in one grid, it can't also come down in a neighboring grid.  On the plus side, the physical models construct an entire series of data (solar radiation, dew point, fluxes, etc) that normal weather stations do not measure.  On the downside, the imposed differential equations that relate all weather measures imply that interpolated data do not always match actual observations.

So how do the degree days in Massetti et al. compare to ours? Here's a little detour on degree days - this is a bit technical and dry, so please be patient.  The first statistical study my coauthors and I published using degree days in 2006 used monthly temperature data since we did not have daily temperature data at the time.  Since degree days depend how many times a temperature threshold is passed, monthly averages can be a challenge as a temporal average will hide how many times a threshold is passed.  The literature has gotten around this problem by estimating an empirical link between the standard deviation in daily and monthly temperatures, called Thom's formula. We used this formula was used to derive fluctuations in average daily temperatures to derive degree days.

The interpolation of the temperature distribution when only knowing monthly averages is certainly not ideal, and we hence went through great length to better approximate the temperature distribution. All of my subsequent work with various coauthors hence not only looked at the distribution of daily average temperatures within a month, but went one step further by looking at the temperature distribution within a day.  The rational is that even if average daily temperatures do not cross a threshold, the daily maximum might.  We interpolated daily maximum and minimum temperature, and fit a sinusoidal curve between the two to approximate the distribution within a day (See Snyder). This is again an interpolation and might have its own pitfalls, but one can empirically test whether it improves predictive power, which we did and will do for part 3 of this series.

Here is my beef with Massetti et al: Our subsequent work in 2008 showed that calculating degree days using the within-day distribution of temperatures is much better.  We even emphasize that in a panel setting average temperatures perform better than degree days derived using Thom's formula (but not in the cross-section as the Thom's approximation works much better at getting average number of degree days correct than year-to-year fluctuations around the mean). What I find disingenuous in the Massetti et al. is that it makes a general statement about comparing degree days to average temperature, yet only discusses the inferior approach for calculating degree days using Thom's formula.  What makes things worse is that we shared our "better" degree days data that uses the within day distribution with them (which they acknowledge).

Unfortunately, Massetti et al. decided not to share their data with us, so the analysis below uses our construction of their variables.  We downloaded surface temperature from NARR.  The reanalysis data provides temperature readings at several altitude levels above ground, and in general, the higher the reading above the ground, the lower temperatures, which will result in lower degree day numbers.

The following table constructs degree days for counties east of the 100 degree meridian in various ways.  Columns (1a)-(3b) use the NARR data, while column (4b) uses our 2008 procedure. Columns (a) use the approach of Massetti et al. and derive the climate in a county as the inverse-distance weighted average of the four NARR grids surrounding a county centroid.  Columns (b) calculate degree days for each 2.5x2.5mile PRISM grid within a county (squared inverse-distance weighted average of all NARR grids over the US) and derives the county aggregate as the weighted average of all grids where the weight is proportional to the cropland area in a county. Results don't differ much between (a) and (b).

Columns (1a)-(1b) follow Massetti et al. and first derive average daily temperatures and degree days using daily averages, i.e., degree days are only positive if the daily average exceeds the threshold. Columns (2a)-(2b) calculate degree days for each 3-hour reading. Degree days will be positive if part of the temperature distribution is above the threshold, but not the daily average.  Columns (3a)-(3b) approximate the temperature distribution within a day by linearly interpolating between the 3-hour measures.  Column (4b) uses a sinusoidal approximation between the daily minimum and maximum to approximate the temperature distribution within a day.
Average temperature and average season-total degree days 8-32C in 1979-2011 are fairly consistent between all columns.  We give the mean outcome in a county as well as two standard derivations: the between standard deviation (in round brackets) is the standard deviation in the average outcome between counties, while the within standard deviation [in square brackets] is the average standard deviation of the year-to-year fluctuations around a county mean. The between standard deviation is fairly consistent across columns, but the within-county standard deviation is much lower for our interpolation in column (4b).

As a result of the lower within-county variation, fluctuations are lower and hence the threshold is passed less often in column (4b).  Extreme heat as measured by degree days above 29C or 34C are hence lower when the within-day distribution is use din column (4b) compared to columns (2a)-(3b). There are two possible interpretation: either our data is over-smoothing and hence under-predicting the variance, or NARR has measurement error which will lead to attenuation bias.  We will test both possible theories in part 3 tomorrow.

Tuesday, December 31, 2013

Massetti et al. - Part 1 of 3: Convergence in the Effect of Warming on US Agriuclture

Emanuele Massetti has posted a new paper (joined with Robert Mendelsohn and Shun Chonabayashi) that takes another look at the best climate predictor of farmland prices in the United States.  He'll present it at the ASSA meetings in Philadelphia - I have seen him present the paper at the 2013 NBER spring EEE meeting and at the 2013 AERE conference, and wanted to provide a few discussion points for people interested in the material.

A short background: several articles of contributors to this blog have found that temperature extremes are crucial at predicting agricultural output. To name a few: Maximilian Auffhammer and coauthors have shown that rice have opposite sensitivities to minimum and maximum temperature, and this relationship can differ over the growing season (paper). David Lobell and coauthors found that there is a highly nonlinear relationship between corn yields and temperature using data from field trials in Africa (paper), which is comparable to what Michael Roberts and I have found in the United States (paper).  The same relationship was observed by Marshal Burke and Kyle Emerick when looking at yield trends and climate trends over the last three decades (paper).

Massetti et al. argue that average temperature are a better predictor of farmland values than nonlinear transformations like degree days.  They exclusively rely on cross-sectional regressions (in contrast to the aforementioned panel regressions), re-examining earlier work Michael Hanemann, Tony Fisher and I have done where we found that degree days are better and more robust predictors of farmland values than average temperature (paper).

Before looking into the differences between the studies, it might be worthwhile to emphasize an important convergence in the sign and magnitude of predicted effect of a rise in temperature on US agriculture.  There has been an active debate whether a warmer climate would be beneficial or detrimental. My coauthors and I have usually been on the more pessimistic side, i.e., arguing that warming would be harmful. For example, a +2C and +4C increase, respectively, predicted a 10.5% and 31.6 percent decrease in farmland values in the cross-section of farmland values (short-term B1 and long-term B2 scenarios in Table 5)  and a 14.9 and 35.3 percent decrease in corn yields in the panel regression (Appendix Table A5).

Robert Mendelsohn and various coauthors have consistently found the opposite, and the effects have gotten progressively more positive over time.  For example, their initial innovative AER paper that pioneered the cross-sectional approach in 1994 argued that "[...] our projections suggest that global warming may be slightly beneficial to American agriculture." Their 1999 book added climate variation as an additional control and argued that "Including climate variation suggests that small amount of warming are beneficial," even in the cropland model.  A follow-up paper in 2003 further controls for irrigation and finds that "The beneficial effect of warmer temperatures increases slightly when water availability is included in the model."

There latest paper finds results that are consistent with our earlier findings, i.e., a +2C warming predicts decreases in farmland values of 20-27 percent (bottom of Table 1), while a +4C warming decreases farmland values by 39-49 percent. These numbers are even more negative than our earlier findings and rather unaffected whether average temperatures or degree days are used in the model.  While the authors go on to argue that average temperatures are better than degree days (more on this in future posts), it does change the predicted negative effect of warming: it is harmful.

Monday, December 23, 2013

The Red Queen strikes again

The weekend before last I attended an interesting CIMMYT meeting on remote sensing in Mexico City. Lots of cool stuff going on in remote sensing for agriculture, including use of drones in breeding programs, and near-term prospects for low-cost or free satellite data with high spatial and temporal resolution. But one of the most interesting parts of the meeting for me was catching up with Dave Hodson, a colleague who used to work in CIMMYT’s GIS group and now works full time on monitoring wheat rusts. He’s part of the Borlaug Global Rust Initiative (BGRI) which was started in the wake of the discovery of the UG99 strain of stem rust in 1999.

A quick review: rusts are a nightmare for wheat growers or breeders. They can decimate a wheat crop and can spread incredibly quickly and far. There are three main types of rust: stem rust, yellow (or stripe) rust, and leaf rust. One of the main precursors of the Green Revolution was improving rust resistance of wheat varieties, part of Norman Borlaug’s claim to fame. Breeders must continually make sure their varieties are not too susceptible to rust, and since rusts evolve over time it is often a race just to avoid going backward. That’s why it is often called Red Queen breeding, named after the scene in Throughthe Looking Glass where Alice learns she has to run just to stand still.

The same rust resistance genes were successful for a very long time, until the UG99 strain came along and proved to be a major problem for nearly all widely grown varieties. In stepped scores of wheat scientists, who quickly developed new resistant varieties that have since been widely adopted. With the help of Borlaug, and the Gates Foundation, the BGRI was set up to maintain an internationally coordinated system to monitor and respond to any future rust outbreaks.

Ok, now to the interesting part. A few weeks ago, surveyors in Ethiopia uncovered a sizable amount of wheat area (~10,000 ha) that had been wiped out by stem rust. These varieties were resistant to the known UG99 strains, so it seems that a new strain has emerged. It’s too early to know what this will imply, but an update was posted today on their website, including the picture of an affected field below.



As scary as rust is, the news isn’t all bad. The systems put in place by BGRI have already had several successes, though avoiding something bad happening rarely makes the news. For example, a few years ago, in late 2010, there was a big outbreak of yellow rust in Ethiopia. Roughly a third of the entire wheat crop was lost. This year, there were conditions favorable for yellow rust, and heavy incidence was spotted. But it was spotted early, and fungicides were used to contain the outbreak, and impacts were very small. (Why rusts seem to be happening more often is a topic of debate, and some would blame climate change, but that's a topic for another day).


As this new strain of UG99 emerges, you can see the capacity of BGRI and its partners spring to action. Samples of the spores have already been sent to labs around the world to assess what exactly they are dealing with. Fungicides are being targeted to the areas with active outbreaks. Modelers are looking at potential areas where the spores could spread in the near term, as shown in the figure below from their update. (Now is sowing time throughout much of the Middle East and West and South Asia, so spores reaching there could have big impacts). And breeders will likely soon be sending lines to Ethiopia for screening. 


To me this is a reminder of both how many things can go wrong when trying to produce food, but also how so many hard working, smart people help to bring resilience to modern agriculture. The next time you hear someone talking about “resilience” of agriculture as if it were solely the result of what particular mix of crops or soil biota are in a particular field, you should think about people like Dave Hodson and his colleagues. The resilience of modern agriculture, for better or worse, rests on the tireless but rarely celebrated work of people like them.

Thursday, December 19, 2013

The three wise men (of agriculture)

There’s a new book coming out soon that should be of interest to many readers of this blog. It’s written by Tony Fischer, Derek Byerlee, and Greg Edmeades, and called Crop yields and global food security: will yield increases continue to feed the world?” At 550 pages, it’s not a quick read, but I found it incredibly well done and worthwhile. I’m not sure yet when the public release will be, but I’m told it will be a free download in early 2014 at the Australian Centre for International Agricultural Research website.

The book starts by laying out the premise that, in order to achieve improvements in global food security without massive land use change, yields of major crops need to increase about 1.3% of current levels per year for the next 20 years. They explain very clearly how they arrive at this number given trends in demand, with a nice comparison with other estimates. The rest of the book is then roughly in two parts. First is a detailed tour of the worlds cropping system to assess the progress over the last 20 years, and second is a discussion of the prospects for and changes needed to achieve the target yield gains.

For some, the scope of the book may be too narrow, and the authors fully recognize that yield progress is not alone enough to achieve food security. But for me, the depth is a welcome change from a lot of more superficial studies of yield changes around the world. These are three men who understand the different aspects of agriculture better than just about anyone.

The book is not just a review of available information; the first part presents a lot of new analysis as well. Tony Fischer has dug into the available data on farm and experimental plot yields in each region, with his keen eye for what constitutes a credible study or yield potential estimate (think Warren Buffet reading a financial prospectus). This effort results in an estimate of yield potential and yield gap (the difference between potential and farm yields) by mega-environment and their linear rate of change for the past 20 years. The authors then express all trends as a percentage of trend yield in 2010, which makes it much easier to compare estimates from various studies that often report in kg/ha or bushels/acre or some other unit.
There are lots of insights in the book, but here is a sample of three that seemed noteworthy:

  1. Yield potential continues to exhibit significant progress for all major crops in nearly all of their mega-environments. This is counter to many claims of stagnating progress in yield potential.
  2. Yield gaps for all major crops are declining at the global scale, and these trends can account for roughly half of farm yield increases globally since 1990. But there’s a lot of variation. I thought it interesting, for example, that maize gaps are declining much faster in regions that have adopted GM varieties (US, Brazil, Argentina) than regions that haven’t (Europe, China). Of course, this is just a simple correlation, and the authors don’t attempt to explain any differences in yield gap trends.
  3. Yield gaps for soy and wheat are both quite small at the global level. Soy in particular has narrowed yield gaps very quickly, and in all major producers it is now at ~30%, which is the lower limit of what is deemed economically feasible with today’s technology. One implication of this is that yield potential increases in soy are especially important. Another is that yield growth in soy could be set to slow, even as demand continues to rise the most of any major crop, setting up a scenario for even more rapid soy area expansion.

Any of these three points could have made for an important paper on their own, and there are others in the book as well. But to keep this post at least slightly shorter than the actual book, I won’t go on about the details. One more general point, though.  The last few years of high food prices has brought a flurry of interest to the type of material covered in this book. For those of us who think issues of food production are important in the long-term, this is generally a welcome change. But one downside is that the attention attracts all sorts of characters who like to write and say things to get attention, but don’t really know much about agriculture or food security. Sometimes they oversimplify or exaggerate. Sometimes they claim as new something that was known long ago. This book is a good example of the complete opposite of that – three very knowledgeable and insightful people homing in on the critical questions and taking an unbiased look at the evidence.


(The downside is that it is definitely not a light and breezy read. I assigned parts of it to my undergrad class, and they commented on how technical and ”dense” it was. For those looking for a lighter read, I am nearly done with Howard Buffet’s “40 Chances”. I was really impressed with that one as well – lots of interesting anecdotes and lessons from his journeys around the world to understand food security. It’s encouraging that a major philanthropist has such a good grasp of the issues and possible solutions.) 

Tuesday, December 17, 2013

Yet another way of estimating the damaging effects of extreme heat on yields

Following up on Max's post on the damaging effects of extreme heat, here is yet another way of looking at it.  So far, my coauthor Michael Roberts and I have estimated three models that links yields to temperature:

  1. An eighth-order polynomial in temperature
  2. A step function (dummy intervals for temperature ranges)
  3. A piecewise linear function of temperature
Another semi-parametric way to estimate this to derive splines in temperature.  Specifically, I used the daily minimum and maximum temperature data we have on a 2.5x2.5mile grid, fit a sinusoidal curve between the minimum and maximum temperature, and then estimated the temperature at each 0.5hour interval.  The spline is evaluated for each temperature reading and summed over all 0.5hour intervals and days of the growing season (March-August).

So what is it good for? Well, it's smoother than the dummy intervals (which by definition assume constant marginal impact within each interval), yet more flexible than the 8th-order polynomial, and doesn't require different bounds for different crops like the piecewise linear function.

Here's the result for corn (the 8 spline knots are shown as red dashed lines), normalized relative to a temperature of 0 degree Celsius.

The regression have the same specification as our previous paper, i.e., the regress log yields on the flexible temperature measure, a quadratic in season-total precipitation, state-specific quadratic time trends as well as county fixed effects for 1950-2011.  

Here's the graph for soybeans:

A few noteworthy results: The slope of the decline is similar to what we found before:  A linear approximation seems appropriate (restricted cubic splines are forced to be linear above the highest knot, but not below). In principle, yields of any type of crop could be regressed on these splines.

Sunday, December 1, 2013

It's not the model. Really it isn't

There is a most lively discussion as to whether climate change will have significant negative impacts on US agriculture. There are a number of papers by my co-bloggers (I am not worthy!) showing that extreme heat days will have significant negative impacts on yields for all major crops except for rice. I will talk about rice another day. For the main crop growing regions in the US, climate models project a significant increase in these extreme heat days. This will likely, short of miraculous adaptation, lead to significant yield losses. To put it simply, this part of the literature has shown a sensitivity of yields to extreme temperatures and linked it with projected increases in these extreme temperature events

On the other hand, there are a number of papers, which argue that climate change will have no significant impacts on US agriculture. Seo, in a recent issue of Climatic Change, essentially argues that the literature projecting big impacts confuses weather ("panel models") and climate ("cross sectional models") and that using weather instead of climate as a source of identification leads to big impacts. As Wolfram Schlenker and I note in a comment this is simply not true for five reasons:

1) Even the very limited number of papers he cites, which use weather as the source of variation to identify a sensitivity, clearly state what this means when interpreting the resulting coefficients. There is no confusion here.

2) He fails to discuss the fact that the bias from adaptation when using weather as a source of variation could go in either direction.

3) It is simply not true that all panel models find big impacts and all Ricardian cross sectional models find small impacts. There are big and small impacts to be found in both camps.

4) There is recent work by Burke and Emerick, which uses the fixed effects identification strategy with climate on the right hand side! I wish I would have thought of that. They can compare their "long differences" (a.k.a. climate) sensitivity results to more traditional weather sensitivity results and find no significant difference between the two. This will either enrage both camps or make them very happy, since it suggests that the difference between sources of variation (weather versus climate) in this setting is not huge. 

5) The big differences in studies may finally not be due to differences in sensitivities, but differences in the climate model used. Burke et al. point out that uncertainty over future climate is a major driver of variation in impacts. We refer the reader to this excellent study, which discusses a much broader universe of studies and very carefully discusses the sources of uncertainty in impacts estimates.

We are of the humble opinion, that the most carefully done studies using both identification strategies yield similar estimates for the Eastern United States.


Wednesday, November 20, 2013

Fixed Effects Infatuation

The fashionable thing to do in applied econometrics, going on 15 years or so, is to find a gigantic panel data set, come up with a cute question about whether some variable x causes another variable y, and test this hypothesis by running a regression of y on x plus a huge number of fixed effects to control for "unobserved heterogeneity" or deal with "omitted variable bias."  I've done a fair amount of work like this myself. The standard model is:

y_i,t = x_i,t + a_i + b_t + u_i,t

where a_i are fixed effects that span the cross section, b_t are fixed effects that span the time series, and u_i,t is the model error, which we hope is not associated with the causal variable x_i,t  conditional on a_i and b_t.

If you're really clever, you can find geographic or other kinds of groupings of individuals, like counties, and include group-by-year fixed effects:

y_i,t = x_i,t + a_i + b_g,t + u_i,t

The generalizable point of my lengthy post the other day on storage and agricultural impacts of climate change, was that this approach, while useful in some contexts, can have some big drawbacks. Increasingly, I fear applied econometricians misuse it.  They found their hammer and now everything is a nail.

What's wrong with fixed effects? 

A practical problem with fixed effects gone wild is that they generally purge the data set of most variation.  This may be useful if you hope to isolate some interesting localized variation that you can argue is exogenous.  But if the most interesting variation derives from a broader phenomenon, then there may be too little variation left over to identify an interesting effect.

A corollary to this point is that fixed effects tend to exaggerate attenuation bias of measurement errors since they will comprise a much larger share of the overall variation in x after fixed effects have been removed.

But there is a more fundamental problem.  To see this, take a step back and think generically about economics.  In economics, almost everything affects everything else, via prices and other kinds of costs and benefits.  Micro incentives affect choices, and those choices add up to affect prices, cost and benefits more broadly, and thus help to organize the ordinary business of life.  That's the essence of Adam's Smith's "invisible hand," supply and demand, and equilibrium theory, etc.  That insight, a unifying theoretical theme if there is one in economics, implies a fundamental connectedness of human activities over time and space.   It's not just that there are unobserved correlated factors; everything literally affects everything else.  On some level it's what connects us to ecologists, although some ecologists may be loath to admit an affinity with economics.

In contrast to the nature of economics, regression with fixed effects is a tool designed for experiments with repeated measures.  Heterogeneous observational units get different treatments, and they might be mutually affected by some outside factor, but the observational units don't affect each other.  They are, by assumption, siloed, at least with respect to consequences of the treatment (whatever your x is).  This design doesn't seem well suited to many kinds of observational data.

I'll put it another way.  Suppose your (hopefully) exogenous variable of choice is x, and x causes z, and then both x and z affect y.  Further, suppose the effects of x on z spill outside of the confines of your fixed-effects units.  Even if fixed effects don't purge all the variation in x, they may purge much of the path going from x to z and z to y, thereby biasing the reduced form link between x and y. In other words, fixed effects are endogenous.

None of this is to say that fixed effects, with careful account of correlated unobserved factors, can be very useful in many settings.  But the inferences we draw may be very limited.  And without care, we may draw conclusions that are very misleading. 

Monday, November 11, 2013

Can crop rotations cure dead zones?

It is now fairly well documented that much of the water quality problems leading to the infamous "dead zone" in the Gulf of Mexico (pictured above) come from fertilizer applications on corn. Fertilizer on corn is probably a big part of similar challenges in the Chesapeake Bay and Great Lakes.

This is a tough problem.  The Pigouvian solution---taxing fertilizer runoff, or possibly just fertilizer---would help.  But we can't forget that fertilizer is the main source of large crop productivity gains over the last 75 years, gains that have fed the world.  It's hard to see how even a large fertilizer tax would much reduce fertilizer applications on any given acre of corn.

However, one way to boost crop yields and reduce fertilizer applications is to rotate crops. Corn-soybean rotations are most ubiquitous, as soybean fixes nitrogen in the soil which reduces need for applications on subsequent corn plantings.  Rotation also reduces pest problems.  The yield boost on both crops is remarkable.  More rotation would means less corn, and less fertilizer applied to remaining corn, at least in comparison to planting corn after corn, which still happens a fair amount.

I've got a new paper (actually, an old but newly revised), coauthored with Mike Livingston of USDA and Yue Zhang, a graduate student at NCSU, that might provide a useful take on this issue.  This paper has taken forever.  We've solved a fairly complex stochastic dynamic model that takes the variability of prices, yields and agronomic benefits of rotation into account. It's calibrated using the autoregressive properties of past prices and experimental plot data.  All of these stochastic/dynamics can matter for rotations. John Rust once told me that Bellman always thought crop rotations would be a great application for his recursive method of solving dynamic problems.

Here's the jist of what we found:

Always rotating, regardless of prices, is close to optimal, even though economically optimal planting may rotate much less frequently.  One implication is that reduced corn monoculture and fertilizer application rates might be implemented with modest incentive payments of $4 per acre or less, and quite possibly less than $1 per acre.

In the past I've been skeptical that even a high fertilizer tax could have much influence on fertilizer use. But given low-cost substitutes like rotation, perhaps it wouldn't cost as much as some think to make substantial improvements in water quality.

Nathan Hendricks and coauthors have a somewhat different approach on the same issue (also see this paper).  It's hard to compare our models, but I gather they are saying roughly similar things.

Friday, November 8, 2013

More fun with MARS

(But not as much fun as watching Stanford dominate Oregon last night).

In a recent post I discussed the potential of multivariate adaptive regression splines (MARS) for crop analysis, particularly because they offer a simple way of dealing with asymmetric and nonlinear relationships. Here I continue from where I left off, so see previous post first if you haven’t already.

Using the APSIM simulations (for a single site) to train MARS resulted in the selection of four variables. One of them was related to radiation which we don’t have good data on, so here I will just take three of them, which were related to: July Tmax, May-August Tmax, and May-August Precipitation. Now, the key point is we are not using those variables as the predictors themselves, but instead using hinge functions based on them. The below figure shows specifically what thresholds I am using (based on the MARS results from previous post) to define the basis hinge functions.  



I then compute these predictor values for each county-year observation in a panel dataset of US corn yields, then subtract county means from all variables (equivalent to introducing county fixed effects), and fit three different regression models:

Model 1: Just quadratic year trends (log(Yield) ~ year + year^2). This serves as a reference “no-weather” model.
Model 2: log(Yield) ~  year + year^2 + GDD  + EDD + prec + prec^2. This model adds the predictors we normally use based on Wolfram and Mike’s 2009 paper, with GDD and EDD meaning growing degree days between 8 and 29 °C and extreme degree days (above 29 °C). Note these measures rely on daily Tmin and Tmax data to compute the degree days.
Model 3: log(Yield) ~  year + year^2 + the three predictors shown in the figure above. Note these are based only on monthly average Tmax or total precipitation.

The table below shows the calibration error as well as the mean out-of-sample error for each model. What’s interesting here is that the model with the three hinge functions performs just as well as (actually even a little better than) the one based on degree day calculations. This is particularly surprising since the hinge functions (1) use only monthly data and (2) were derived from simulations at a single site in Iowa. Apparently they are representative enough to result in a pretty good model for the entire rainfed Corn Belt.

Model
Calibration R2
Average root mean square error for calibration
Average root mean square error for out-of-sample data
 (for 500 runs)
% reduction in out-of-sample error
1
0.59
0.270
.285
--
2
0.66
0.241
.259
8.9
3*
0.68
0.235
.254
10.7
*For those interested, the coefficients on the three hinge terms are -.074, -.0052, and -.061 respectively

The take home here for me is that even a few predictors based on monthly data can tell you a lot about crop yields, BUT it’s important to account for asymmetries. Hinge functions let you do that, and process-based crop models can help identify the right hinge functions (although there are probably other ways to do that too).

So I think this is overall a promising approach – one could use selected crop model simulations from around the world, such as those out of agmip, to identify hinge functions for different cropping systems, and then use these to build robust and simple empirical models for actual yields. Alas I probably won’t have time to develop it much in the foreseeable future, but hopefully this post will inspire something.