1 Introduction

Globally, agricultural production needs to be increased by 70–100% by 2050 to ensure that a global population of over 9 billion can be fed [14]. It has been projected that a global decline in annual growth of food production from about 2.2 to 1.1% is likely to occur for the period 2006–2050 [6]. In Africa, the annual growth rate is projected to decline from 3.0 to 2.1% for the period 2006–2050 [6]. The repercussions of this decline are likely to be more daunting as agricultural production is essentially carried out by small-scale peasant farmers who constitute about 70% of the farming population. There are enormous difficulties associated with producing food under such constrained conditions. Small-scale farmers are less capable of co** with complex multi-level climatic and socio-economic constraints that have implications on food production. The challenge of co** with the twin constraints of climatic and socio-economic constraints is further compounded by global environmental changes that affect crop production. Some of these constraints are yield and precipitation gaps, driven by precipitation, degraded soils, lack of access to farm inputs, and crop pests and diseases [5, 51, 53, 62].

Agriculture is the ‘’life wire’’ or ‘’backbone’’ of the Ugandan economy. This assertion is true as agriculture accounts for about 20% of the country’s gross domestic product (GDP) and about 48% of export earnings [34]. In Uganda, agriculture employs more than 70% of the population and about 4 million people depend on small-scale farming for their sustenance [34]. It has also been stated that, in Uganda, poverty reduction is contingent on developments in agriculture [30, 34, 49]. This is made difficult as Ugandan crop** systems are susceptible to climatic conditions. This is seen as major droughts in the last decade had significant impacts on yields and crop prices in 2006. The effects of the 2010 and 2011 droughts led to deficits of 2.8 trillion (2.8 × 1012) Uganda shillings; an equivalent of US$ 1.2 billion (US$1.2 × 109); 7% of Uganda’s GDP [13].

In the peer review scholarship, a lot of emphasis has not been placed on maize yield gaps in Uganda. The only studies that have come close to handling yield gaps at the level of Uganda are: Wang et al. [64] dwelling on coffee yield gaps and Mugisha et al. [44] focusing on yield gaps in groundnuts using a gender-based perspective. Also, Senthilkumar et al. [57] dwelled on rice yield gaps in eastern and southern Africa. Other studies have focused on the magnitude of precipitation deficits and temperature changes, [41, 42]. Within this context, and in view of the importance of maize in Uganda an analysis of maize yield gaps in Uganda is novel and original as this has not been done before. This study therefore contributes to the scholarship in yield gaps and is a pioneer in maize yield gaps in Uganda. It has been argued that the effects of precipitation gaps on crops yields may depend on the adaptive capacity of the farmers [59]. In the face of very huge precipitation gaps, the effects might be determined by the ability of the farmers to adapt, in other words, the socio-economic conditions of the farmers through proxies such as literacy and poverty which may influence adaptive capacity more than just the magnitude of the precipitation gaps [59].

An assessment of the relationship between actual and projected maize yields on the one hand and actual and projected precipitation on the other hand is important for agricultural adaptation [6]. This approach also offers insights into agricultural performance, the potential for yield growth and an opportunity to monitor and anticipate yield gaps. It also heralds an opportunity to explore the role of non-climatic drivers of the observed yield trends and the role of other constraints such as soils and socio-economic circumstances in narrowing yield gaps. An understanding of the extent to which climatic constraints contribute to explaining the yield gaps can inform adaptation by creating opportunities to verify other non-climatic constraints. When climatic constraints such as precipitation are of less importance in accounting for crop yield gaps, a tilt towards socio-economic drivers is important. The climate of Uganda is diversified, and this offers a huge potential for the development of a wide range of food systems. However, variations in precipitation often lead to yield gaps and this is often confounded by constraints of degraded soils and socio-economic constraints. Within this context, this study considers actual maize yields as the actual observed harvest that the farmers obtain in a year. On the other hand, the projected maize yields represent the simulated, forecasted maize yields for a given year. Actual precipitation on the other hand is the observed precipitation obtained during the maize growing season while projected precipitation is the simulated or forecasted precipitation received during the maize growing season [7].

This study therefore has as primary objectives to (1) identify maize yield and precipitation gaps in Uganda based on time series data for the period 1998–2017 in Uganda and (2) seeks to discuss the role of precipitation and other possible drivers of maize yield gaps as reported in the scientific scholarship. This study is important because it uses maize (Zea mays) as the main crop for analysis for the following reasons: (1) it is among the most widely cultivated crops in the world (maize, wheat, rice, soybeans, barley, sorghum). It is affordable and most widely grown in most African countries and in Uganda [8, 15, 38]. (2) In Uganda, maize is consumed as staple fermented dough, roasted, used as corn porridge, or used as ‘’corn beer.’’ (3) Maize is produced primarily (~ 70–90%) by small-scale farmers [8, 16, 46, 49] and (4) Ugandan maize is also grown across the country in differing agro-climatic zones, requiring medium (500 mm/growing season month) to high (800 mm/growing season month) precipitation [46]).

2 Material and methods

This study is based on time series data of actual observed maize yields (hg/ha/year) and actual observed maize growing season precipitation for Uganda. The maize yield data were obtained from the Food and Agricultural Organization, FAOSTAT [17] website (http://faostat.fao.org). The time series of maize data covered a 20-year period from 1998 to 2017 during which enough data were available. The actual maize yield data were subjected to detrending by removing a linear model of the time series of the actual observed maize yields by dividing the projected linear trend by the actual linear trend (see Eq. 1). Detrending helps to remove the repercussions of increased technology, illustrates annual maize yield variations as a result of precipitation, and reduces the effects of consistent errors in reporting [36, 37, 39].

On the other hand, the actual observed time series of average growing season precipitation for Uganda for the period 1998–2017 were generated from climate portal of the World Bank Group [65]. These data were validated by averaging over the maize growing months for each 5′ × 5′ grid for Uganda from the Global Crop Calendar Dataset [52]. Rather than use annual averages of precipitation, this study identified and defined the maize growing season precipitation for Uganda (Fig. 1). Spatial variations in the maize growing season exist in Uganda. According to various maize crop calendars [17, 18, 24, 52], the south of Uganda has a bi-modal maize growing season. The first maize growing season begins with sowing in February and March, growing in April and May while harvesting occurs in June and July. The second maize growing season begins with sowing in September and October, growing in November and harvesting in December. The north has a uni-modal (mono-modal) or single growing season. Sowing occurs in April and May, growing in June and July and harvesting in August and September (Fig. 1.).

$${Projected}_{ty}=ax+b$$
(1)

where \({Projected}_{ty}\) is the projected/simulated theoretical maize yield, χ is the year, a is the linear trend, b is the intercept when \({Projected}_{ty}=ax\).

Fig. 1
figure 1

Source: Author’s conceptualization inspired from; FAO [18]

Maize crop calendar for Uganda.

To be able to compute maize yield and precipitation gaps and surpluses, projected maize yields and projected growing season precipitation had to be estimated. The projected yields were simulated for each year by using the trend line equation for a simple linear regression (Eq. 2) while the projected growing season precipitation were projected by using the trend line equation for a simple linear regression for growing season precipitation (Eq. 3).The intercepts and slopes or linear trend lines for both maize yield and growing season precipitation were computed using the slope and intercept functions in excel. The slope and intercept are based on the relationship between the actual observed yield, precipitation, and time (Eq. 4 and 5).

$${Projected}_{y}=536.45x+14543$$
(2)

where \({Projected}_{y}\) is the projected/simulated maize yield, χ is the year, 536.45 is the linear trend/slope, 14,543 is the intercept when \({Projected}_{y}=536.45x.\)

$${Projected}_{p}=-0.0332x+107.41$$
(3)

where \({Projected}_{p}\) is the protected/simulated growing season precipitation, χ is the year, − 0.0332 is the linear trend/slope, 107.41 is the intercept when \({Projected}_{p}=-0.0332x\).

$${Intercept}_{yp} =\mathrm{ intercept} \,(\mathrm{ time \,series \,of \,yield \,or \,ppt}{:} \mathrm{ observed \,yield \,or \,ppt})$$
(4)

where \({Intercept}_{yp}\) is the intercept of yield and precipitation

$${Slope}_{yp} =\mathrm{ slope} \,(\mathrm{time \,series \,of \,yield \,or \,ppt}{:}\mathrm{ observed \,yield \,or \,ppt})$$
(5)

where \({Slope}_{yp}\) is the slope of yield and precipitation.

Once the projected yields and growing season precipitation were computed, the resulting outputs were used to compute the yield and precipitation gaps and surpluses for the various years. The gaps and surpluses were based on the differences observed between actual observed yields/growing season precipitation and projected/simulated yields/growing season precipitation (Eqs. 6 and 7). Based on the use of actual and projected precipitation and yield data in this study, the following hypothesis can be formulated: when actual precipitation and yields are lower than projected precipitation and yields, precipitation and yield gaps are said to occur.

$${Yieldgaps}_{ys}={Actual}_{y}-{Projected}_{y}$$
(6)

where \({Yieldgaps}_{ys}\) represents yield gaps or surplus, \({Actual}_{y}\) is the actual/observed yields, \({Projected}_{y}\) is the projected/simulated yeild

$${PPTgaps}_{s}={Actual}_{ppt}-{Projected}_{ppt}$$
(7)

where \({PPTgaps}_{s}\) represents precipitation gaps or surplus, \({Actual}_{ppt}\) is the actual/observed precipitation, \({Projected}_{ppt}\) is the projected/simulated precipitation.

3 Results

3.1 Lower actual precipitation over projected precipitation drives precipitation gaps

The average annual actual growing season precipitation recorded for the period 1998–2017 is 107.06 mm (Fig. 2). However, the maximum or highest record of average annual actual growing season precipitation for a single year was 147.55 mm; it was recorded in 2010. It can be observed that, the average annual actual growing season precipitation for 2010 of 147.55 mm is above the average of 107.06 mm for the period 1998–2017 (Fig. 2). On the other hand, the minimum or lowest record of annual growing season precipitation was 86.46 mm, recorded in 2000. This minimum is below the average for the entire period 1998–2017 and the parallel precipitation gap for that year is − 20.84 mm. In the latter case, the projected is higher than the actual. The maximum actual annual growing season precipitation of 147.55 mm recorded in 2010 is higher than the projected average annual growing season precipitation of 106.98 mm recorded for the same year 2010. Since the actual annual average growing season precipitation for 2010 is higher than the projected, a surplus in precipitation of 40.57 mm is recorded in 2010 (Fig. 2). Therefore, it has been observed that when the actual average annual growing season precipitation is higher than the projected annual growing season precipitation, a surplus in precipitation is recorded.

Fig. 2
figure 2

Actual (a), projected (b) average maize growing season precipitation (mm) and c average growing season precipitation (mm) gaps/surpluses

Considering the average annual projected growing season precipitation, it is observed that 1998 recorded the maximum average annual projected growing season precipitation of 107.37 mm (Fig. 2). This is slightly above the average for the 1998–2017 period of 107.06 mm (Fig. 2). At the maximum projected average annual growing season precipitation level for 1998 is recorded a higher actual average annual growing season precipitation of 116.81 mm (Fig. 2). The resultant average annual growing season precipitation surplus is 9.42 mm. On the other hand, the lowest or minimum projected annual growing season precipitation was recorded in 2017 at 106.74 mm. This is slightly below the average for the 1998–2017 period but above the actual average annual growing season precipitation of 97.54 mm (Fig. 2). With the minimum projected average annual growing season precipitation higher than the actual annual growing season precipitation for the same year, a precipitation gap of − 9.20 mm is recorded.

3.2 Lower actual yields over projected yields drives maize yield gaps

In the context of actual yields, an average of 20,175.25 hg/ha (Fig. 3) of maize were recorded for the period 1998–2017. This average is below the maximum or highest of 25,046 hg/ha (Fig. 3) actual maize yield recorded for 2014. Also, the actual maximum maize yield for 2014 is higher than the projected maize yield of 23,662.16 hg/ha (Fig. 3) for the same year. When the actual yield is above the projected yield, a surplus of 1383.83 hg/ha is recorded in 2014. In 2014, the maximum actual yield record of 25,046 hg/ha (Fig. 3) corresponds to an average growing season precipitation of 95.30 mm. However, the projected yield of 23,662.16 hg/ha (Fig. 3) for 2014 corresponds to a higher projected average annual growing season precipitation of 106.84 mm. It can be observed here that higher levels of average annual growing season precipitation are not always associated to higher maize yields.

Fig. 3
figure 3

Actual (a), projected (b) maize yield (hg/ha) and c maize yield (hg/ha) gaps/surpluses

When the projected maize yields are considered, it can be observed that the year 2017 recorded the maximum yields of 25,271.5 hg/ha. The latter is higher than the corresponding actual maize yield of 23,177 hg/ha for 2017. Since the actual maize yield is less than the projected maize yield, a maize yield gap of − 2094.51 hg/ha is recorded. The higher projected maize yield corresponds to a projected annual growing season precipitation of 106.74 mm while the lower actual maize yield for that same year has an actual annual growing season precipitation of 97.54 mm. It can be said here that the higher projected yields are parallel to higher growing season precipitation while the actual yields are lower than the projected yields and so is the corresponding precipitation. On the other hand, the minimum or lowest maize yield of 15,078.93 hg/ha is recorded in 1998. The corresponding actual maize yield for the same year is lower at 15,000 hg/ha. When projected yields are greater than actual yields, a gap in yields is said to exist and in this case a yield gap of − 78.98 hg/ha is recorded.

3.3 Maize growing season precipitation and yield gaps

These results show that during the period 1998–2017 three major episodes of yield gaps were recorded. During these episodes, projected maize yields were above the actual observed maize yields (Fig. 4a). This was first recorded in 1998 with a yield gap of − 78.98 hg/ha. Though this gap did not have a corresponding precipitation gap, the yield gap observed was marked by the onset of precipitation gaps that began in 1999 and extended into 2000 and 2001. The respective precipitation gaps were − 1.02 mm, − 20.84 mm and − 14.07 mm for the years 1999, 2000 and 2001 respectively (Fig. 4b). The second episode of yield gaps was between 2004 and 2007 (Fig. 4a). The yield gaps were − 3897.62 hg/ha in 2004, − 2975.13 hg/ha in 2005, − 4009.58 hg/ha in 2006 and − 4957.03 hg/ha in 2007 (Fig. 4a). Interestingly, this period was also marked by precipitation gaps recorded during the years 2004 and 2005 of − 16.33 mm and − 15.11 mm respectively (Fig. 4b). The third period of maize yield gaps was between 2015 and 2017. Here, yield gaps of − 669.61 hg/ha were observed in 2015, − 1558.07 hg/ha in 2016 and − 2094.5 hg/ha in 2017. These years of yield gaps were also parallel to precipitation gaps of − 5.40 mm, − 8.23 and − 9.20 mm recorded during the years 2015, 2016 and 2017 respectively (Fig. 4b). From these results, it can be observed that some of the years with maize yield gaps also had parallel precipitation gaps. This implies that maize annual growing season precipitation had a positive relationship with maize yields for some years between 1998 and 2017. The only exception observed from these results was for the years 2008 and 2009 during which there were no maize yield gaps as the actual observed yields were above the projected yields (Fig. 4a) yet, precipitation gaps were recorded. In this context it can be said that the observed yield trends were not greatly affected by the observed gaps in precipitation. This is supported by a very low correlation between annual growing season precipitation gaps time series and yield gaps time series of 0.063 or about 6.3%. In other words, the precipitation gaps only weakly explain the yield gaps. Therefore, to better explain maize yield gaps, it is essential to integrate non-climatic variables.

Fig.4
figure 4

a Time series of projected, actual and yield gaps b time series of projected, actual and precipitation gaps in Uganda

These results show that the regression models in Fig. 4a, b fits the observed yield and precipitation data (Figs. 5, 6). In the context of the relationship between actual and projected yields, the coefficient of determination of 0.62 shows that 62% of the data fits the regression (Fig. 4a). In other words, this regression is valid and explains about 62% of the relationship between actual and projected yields. Also, in the context of the relationship between actual and projected precipitation a coefficient of determination of 1 shows that this relationship is very strong and explains about 100% of the relationship between these variables (Fig. 4b). In fact, in 2007, Uganda recorded about 14,000 hg/ha in maize yields. Thereafter, a period of excess production was noted with 22,000 hg/ha in 2008 and 24000hg/ha in 2009. In the time series since 2007, gaps in yield only set in again around 2015 when projected yields exceeded observed yields (Fig. 5). These increases in production were associated to increase precipitation, high yielding varieties, extension services and limited pest outbreaks. When actual precipitation rises, there is a tendency for actual yields to rise, this is also shown by a coefficient of determination of 0.60 which shows that the regression model fits the observed data and that the observed trends in actual maize yield can be explained by 60% of the changes in annual growing season precipitation (Fig. 7a). On the other hand, when projected precipitation rises, actual maize yields also initially rise and after a threshold of about 25,000 hg/ha the more the annual growing season precipitation the more the decline in maize yields (Fig. 7b). This relationship also has a coefficient of determination of about 62% implying that 62% of the changes in actual maize yield can be explained by changes in projected annual growing season precipitation.

Fig. 5
figure 5

Actual and projected maize yield in Uganda

Fig. 6
figure 6

Actual and projected maize growing season precipitation in Uganda

Fig. 7
figure 7

Scatter plots of a actual growing season precipitation against actual maize yield and b projected growing season precipitation and actual maize yield

4 Discussion

In Uganda, precipitation plays a role in determining maize yield gaps. Most of the years during which maize yield gaps occurred were associated with parallel gaps in precipitation. This phenomenon is common in most African countries in which agriculture is essentially precipitation dependent or rain-fed [9, 48]. In Uganda, optimal maize production occurs under precipitation amounts of between 500 and 600 mm well distributed over the growing season [40]. In this study, it has been observed that most of the maize yields obtained were obtained at sub-optimal level as the actual growing season precipitation amounts were often below the projected amounts. However, with a low correlation of about 6.3% between annual growing season precipitation gaps and maize yield gaps, it is obvious that many other factors play a role in the total maize yield trends recorded; precipitation simply reinforces an already bad situation. It has already been argued that in most African countries, agriculture is dependent on precipitation and this presents important challenges to farmers [19, 20, 31, 54, 61]. The situation is even much more daunting as small-scale farmers are responsible for most agricultural production in sub-Saharan Africa (SSA) and are least equipped to adapt [8, 10, 45, 58]. The effects of precipitation gaps also reflects the degree of vulnerability of crop** systems [11, 21, 22, 26, 59].

The role of annual growing season precipitation in conditioning agricultural production across Africa has been subject to debates and arguments in the scientific literature. This study has shown that precipitation has a limit because as crop yields increase with increase precipitation, beyond a certain threshold maize yields begin to decline even as precipitation increases (Fig. 7b). There is increasing evidence across Africa that supports this premise. For example, based on Normalized Difference Vegetation Index (NDVI) studies over Africa, it has been observed that the Sahel for example is getting greener due to an increase in precipitation after the drought decade of 1975–1985 [29]. If precipitation is currently rising in most of the Sahel, then the big question is, why does the region still experience rife rates in food insecurity and gaps in maize yield and other crops? This invariably heralds the idea that the precipitation gains are not often available for agriculture due to an interplay of other variables that are essentially non-climatic such as poorly distributed precipitation, population growth, systems of land use, high yielding varieties, crop pests and accelerated deforestation [28, 29]. However, it has also been argued that the notion of increasing precipitation across most of the Sahel for example should be handled with caution as these findings are based on large scale NDVI based studies which might not adequately reflect what obtains at the catchment area scale in individual African countries [9]. Therefore, a need for finer-scale or country level studies to verify this assertion is recommended [25],this current study is one such example.

Understanding maze yield gaps in general heralds the need for verifications beyond climatic variables. Fertile volcanic soils in Western Uganda along Lake Edward can explain the higher maize yields in that region [33, 34]. The fertile clay soils in the Southwest of the Nebbi district and around **ja and Central Uganda are also driving crop yields positively [33, 34]. In the ‘’Fertile Crescent’’ deep red loam soils have also been favorable to crop production in general. Soils are also drivers of yield gaps. For example, patches of infertile soils such as the montane soils around the upper slopes of Mount Elgon and parts of Western Uganda also drive crop yield gaps in Uganda. The Singo Hills north of Lake Wamala in central Uganda are also included. In the northern parts of Uganda, most of the districts ranging from Gulu, Kitgum, to Moroto and most of Kotido, Kumi and Soroti have mostly soils that are shallow, sandy with low productivity and maize yield gaps [33, 34].

Some other factors affecting maize yields in Uganda have been reported in the scientific scholarship and include but not limited to low adoption of improved varieties (genetics), pests and diseases, limited use of inputs and, poor knowledge on crop management and post-harvest management (extension) [35, 47, 60]. The drought periods between 2003 and 2007 were also associated with an outbreak of gray leaf spot disease and stem borers in Uganda. The drought periods between 2015 and 2017 were also associated with an outbreak of maize lethal necrosis and fall army worm (a new disease and pest) [1, 27, 32]. These pests and diseases outbreak also caused significant maize yield gaps.

Socio-economic differences in Uganda can also explain the existing maize yield gaps. Generally, crop yield gap differences are often evident between the north and the south of Uganda due to socio-economic disparities. In 2010, the poverty rate in northern Uganda was 46.2% and it was higher than the 21.8% recorded in southern Uganda [12]. Poorer farming communities have less access to farm inputs such as fertilizers, high yielding drought resistant maize varieties, and irrigation infrastructure [4]. Literacy rates also vary between southern and northern Uganda. For example, in 2010, literacy rates in southern Uganda were between 63 and 75% while in northern Uganda they ranged between 60 and 63% [63]. Small-scale farmers in northern Uganda lack access to adequate transportation in the context of good roads to transport their farm outputs from their farms to markets. They also do not have sufficient access to fertilizers and high yielding maize varieties [30]. When precipitation-based yield gaps occur, the absence of these socio-economic variables makes it impossible or difficult for the farmers to adjust and invest in farm inputs and irrigation related mechanisms that can improve resilience.

The role of socio-economic disparities in maize yield gaps is not an issue that is peculiar to Uganda only. The degree of socio-economic development; assets, whether financial, human, natural, physical, and social do greatly affect the ability of a community to cope with climate change related problems and effects such as yield gaps across Africa [4, 23, 43, 56]. Socially, it has been argued that in the face of crop yield gaps, well connected households rely on their friends and families for sustenance and support to reverse yield gaps [50]. In high income countries, social safety nets are so strong that during hazards, shelter, food, clothing and even finances are provided. Also, some farmers are more likely to adjust through some other external inputs such as irrigation water to combat yield gaps. Unfortunately, most countries in Africa do not have access adequate access to this. Things are worse as most of the production is in the hands of small-scale peasant farmers. [2, 3, 55].

5 Conclusion

The results from this study have shown that three key periods of maize yield gaps were recorded between 1998 and 2017. Some of these yield gaps were essentially explained by parallel gaps in precipitation. However, maize yield gaps cannot be always explained by gaps in precipitation. In Uganda as well as in other African countries, soil quality related factors as well as socio-economic disparities such as poverty and literacy have a role to play. Therefore, this study validates the hypothesis that maize yield gaps are a function of precipitation gaps. This validation is however to a certain extent as in some cases maize yield surpluses have been observed to be associated to precipitation gaps. This heralds the argument that, food systems are not just impacted by climatic variables alone but increasingly non-climatic variables. Stakeholders in Uganda and Africa in general must invest in climate science, soil related science, farm inputs, high yielding varieties, crop pests and diseases and in bridging socio-economic gaps through poverty alleviation programs. Going forward, it will be important to verify how these gaps play out in the context of other major crops in Uganda and across Africa and to accurately test the role of climatic and non-climatic variables in crop production systems.