basic specification (Table 1) and thus used it throughout our analysis, we do not rule out the possibility that optimal time windows and index types may also differ across space and household groups. Heterogeneity in all those dimensions implies spatial disparities in the RSQ-food consumption relationship and failing to account for these differences may result in large errors when making predictions at sub-national scales. On the other hand, defining an optimal choice to this multi-dimensional problem remains a challenging task. In light of our results in section 4.1, we allow for vulnerability functions to differ across geographic zones, and across household groups within these geographic units. Assuming we have at least three viable geographic breakdown (regions, livelihood zones, rainfall zones) and two household characteristics (primary income source, livestock ownership) to define household groups within geographic units, this already represents 328 possible combinations, each of which determines a set of household typologies. For instance, a regional breakdown (8 regions) with household groups defined based on livestock ownership (5 categories) in all regions would result in 40 household typologies. Conditional on a typology structure, we further assume that RSQ measures can vary across typologies which brings an additional dimension to the optimization problem. We allow for 1- to 5-month precipitation anomalies and 1- to 4-month NDVI, EVI and DMP anomalies, which represent a total of 17 possible RSQ indices for each typology.

We present the results of a food insecurity prediction model where the vulnerability component is optimized with respect to both the heterogeneity structure and RSQ indices at the typology-level based on a machine learning procedure (cross-validation), details of which are provided in appendix D. The cross-validation algorithm uses the Mean Squared Error (MSE) between modeled household food consumption and ground-truth FSMS values to evaluate the performance of the models tested. Our optimal structure has a geographic breakdown based on regions and uses primary income source and livestock ownership as household-level factors to define typologies within regions.<sup>40</sup> We follow the estimation procedure described in section 3.1 and produce food insecurity rate predictions at the national and regional levels for the period 2011-2015 that we compare with estimates from the FSMS. We benchmark the results against a simple model with a unique household typology<sup>41</sup> and baseline food consumption distributions calibrated at the regional-level, in order to appreciate the gains obtained from a more complex vulnerability component. Figure 9a shows the results at the national-level where predictions of – food insecurity rates closely follow FSMS estimates for the period 2011-2015 we find a mean absolute error of 1.2 p.p.<sup>42</sup> The benchmark model that does not account for het40The primary income source is found as the optimal factor in the Brakna, Guidimakha, Hodh Ech Chargi and Gorgol regions while livestock ownership category is preferred in the other four regions (Assaba, Hodh El Gharbi, Trarza, Tagant).

> 41The corresponding vulnerability function is calibrated using the 5-month precipitation z-score.

> 42These results are based on a food insecurity line of 41 because the mode of the FCS in our historical sample coincides with the usual food insecurity line – nearly 6% of FCS values are equal to 42 – which

31