← Back to projects

Early soybean yield estimation

Can you tell how the soybean season is going months before harvest, using only public data?

Data Science · BI · Agriculture

Five months before harvest, the model was already anticipating the 2022/23 drought

Soybean yield, average of 5 counties in northwestern Buenos Aires (qq/ha)

Observed yield and late-November estimate by season
SeasonObserved yieldEstimate as of late November
2016/1736.032.9
2017/1828.831.9
2018/1934.032.9
2019/2033.332.4
2020/2129.532.2
2021/2229.729.7
2022/2316.317.4
2023/2431.133.3
2024/2531.629.8
2025/26season without official data yet31.7 (28.9–33.7)

With data through late November, the error is already the lowest

Mean absolute error by lead time (qq/ha), 45 out-of-sample estimates

Mean absolute error by lead time (qq/ha), 45 out-of-sample estimates
Late Nov (5 months before)2.42 qq/ha
Late Dec (4 months before)2.63 qq/ha
Late Jan (3 months before)3.01 qq/ha
Late Feb (2 months before)2.93 qq/ha
Late Mar (1 month before)3.02 qq/ha
Historical average4.04 qq/ha

What weighs most in the model is the atmosphere’s demand for water

Most important variables in the model with data through late January (Random Forest importance)

  1. 1
    Mean relative humidity (Oct–Jan)approx. 20%
  2. 2
    Mean vapor pressure deficit (VPD)approx. 15%
  3. 3
    NDVI anomaly in late Novembershare not published

Problem

Knowing how the soybean season is shaping up in northwestern Buenos Aires province months before harvest, using only free public data.

Approach

A Python pipeline that combines satellite NDVI (MODIS via Google Earth Engine), daily weather (NASA POWER), and official yields (MAGyP) for 5 counties and 25 seasons (2000/01 to 2024/25). It uses 16 variables per cutoff, including vapor pressure deficit (VPD) and the NDVI anomaly versus normal. One Random Forest per cutoff, with walk-forward temporal validation and 80% conformal prediction intervals. I tried other algorithms, NDVI filtered to soybean, and the El Niño / La Niña signal: none improved the model conclusively.

Result

With data through late November: mean error of 2.42 qq/ha (40% lower error than using the historical average) and R² of 0.72. It gets right whether each county comes in above or below normal in 69% of cases. In the 2022/23 drought yield fell 49%, and by late November the model was already anticipating a 43% drop. The 80% intervals covered between 77% and 87% of cases.

What I learned

The ceiling is the data, not the algorithm: what improved the model most were two agronomically grounded variables (VPD and NDVI anomaly), not switching algorithms. Validate over time instead of fitting to the test. Document the errors: I found and fixed an error in one county's satellite data that was inflating the results.

Tools

Python · Pandas · Scikit-learn · Google Earth Engine · NASA POWER · MODIS NDVI · Vercel

Links

Got a process that could work better?

agustinmusanti@gmail.com