A Bayesian Approach to Evaluating the Dynamics of Rice Production in Madagascar

In Madagascar, domestic rice production does not meet the local demand. Thus, increasing productivity is crucial for ensuring food security for a booming population. The last two decades have been marked by technological improvements in support of a vision of agricultural development. The main objective of the present study is to evaluate rice productivity in Madagascar based on changes in technology and the planted area during the period from 1961 to 2017. To conduct our analysis, we construct a set of statistical models involving time-varying parameters that capture the changes in productivity and progress in rice production technology. To estimate these time-varying parameters, we apply Bayesian methods based on the smoothness prior approach. The estimates for variances in system noise show that the proposed model is well fitted to the data. In addition, the results provide the interesting finding that technological change is estimated to be elastic, with values increasing from 1 to 8 during the six decades of the study period. However, the planted area estimates are inelastic, despite positive values fluctuating around 0.9–1. Thus, rice productivity in Madagascar is highly dependent on technology, although more time is required before a positive response is seen.


Introduction
In Madagascar, the agricultural economy revolves around rice production, which is a staple food item accounting for 44% of local food consumption, as well as the most lucrative crop, accounting for 30% of total income [1]. However, the agricultural sector has performed poorly over the last few decades, with domestic production failing to satisfy local demand, necessitating the importation of rice [2]. This has been at least partly attributable to the booming population, which is mainly composed of rural farming families, and has increased from five million in 1960 to more than 25 million in 2019 [3,4]. Thus, food security has become a crucial issue, and improving rice productivity is a major challenge [5]. Technological improvements have provided support for rice farmers via agricultural projects undertaken by international organizations in an effort to enhance productivity in a sustainable way [6,7,8].
Thus, this study focuses on evaluating the dynamics of rice production in Madagascar. We consider the changes in technology related to rice production and production elasticity with respect to the planted area (hereafter planted area elasticity). The main purpose of this study is the estimation of the time-varying technological elasticity and the time-varying planted area elasticity in Madagascar during the period 1961-2017. Thus, we construct a set of Bayesian linear models with smoothness priors for the time-varying parameters. The models can be expressed in state-space form, and thus we can use Kalman filter algorithms to estimate the time-varying parameters that are involved in the state vector. We hypothesize that rice productivity can be explained by two main factors: improved technology over time, and decreasing planted area elasticity as the planted area has increased. This approach has been used in the few studies applying advanced statistical methods to analyze rice productivity in Madagascar, while other studies have used traditional econometric models. The rest of the paper is structured as follows: Section 2 explains the data used in the analysis and presents the model specifications and the Kalman filter methodology. Section 3 analyzes the estimated results and presents a discussion of the findings. Section 4 concludes.

Data
In this study, we estimated and analyzed rice productivity in Madagascar based on annual time-series data for planted area (ha) and crop yield (tons) during the period from 1961 to 2017. The data were obtained from the FAOSTAT database (2019). Figure 1 shows the analytical process.   Table 1 presents the descriptive statistics based on the raw data. The rice planted area in Madagascar accounts for 12% of the African total of 8 million hectares and 5% of the global total of 160 million hectares. Madagascar is one of the three biggest producers of rice in Africa, together with Egypt and Nigeria. The average yield in Madagascar is less than 0.7 tons/ha, while the average global yield is 3 tons/ha [9]. The Figure 2 shows the time-series data for the rice planted are and rice production in Madagascar from 1961 to 2017. There are similar trends in relation to the planted area and rice production over this period, whereby they both increased from 1960 to 2010, after which they both decreased. This reflects the major political crisis in 2009 that impacted 60% of the rice crop because foreign financial aid ceased until 2013 and interrupted international agricultural development projects, also the impact of climate change causing dryness in 2016 [10][11][12][13]. It can be seen that the planted area roughly doubled from 1960 to 2010, peaking at almost 1.3 million hectares before decreasing sharply to about half that by 2017. Thus, in one decade, Madagascar lost almost half of the rice planted area that had been developed during the five preceding decades. In terms of production, between 1960 and 2000, annual production increased by 71% from 1.4 million tons to 2.4 million tons. Then, from 2000 to 2010, production increased by 83% from 2.4 million tons to 4.4 million tons before declining sharply after 2010. Using the time-series data for the planted area and rice production, we can calculate time-series data for crop yields during the same period (see Figure 3). It can be seen from Figure 3 that yields remained relatively constant at around 2 tons/ha during the period 1961-2000, after which they steadily increased to a peak of 4 tons/ha in 2017.

Model Specification
The model for the production function was constructed using data from the period 1961-2017. We followed Jin and Jorgenson and Kyo et al., who constructed models in a form of a Cobb-Douglas production function based on the assumption of constant elasticity of substitution [14,15]. For the purpose of the present study, we constructed a production function as follows: where Y n denotes rice production, Z n denotes the planted area, A n denotes the technology factor, γ n is the planted area elasticity, and E n is an error term. An important feature of the model shown in Eq. (1) is that the parameters A n and γ n are time-varying, allowing us to analyze the dynamic relationship between rice production (Y n ) and the planted area (Z n ).
Taking the logarithm of both sides of Eq. (1), the following relationship is obtained: logY n =logA n + γ n logZ n + logE n .
This can be expressed as follows by setting y n =log Y n , a n =logA n , z n =logZ n , and e n =logE n : y n = a n + γ n z n + e n , e n ~N (0, σ 2 ). ( To obtain stable estimates of the time-varying parameters an and γn, we use a Bayesian modeling method. We regard the time-varying parameters an and γn as random variables and introduce a set of smoothness priors for them as follows (for more information about the smoothness priors [16], a n =2a n-1 -a n-2 +v n1 , v n1 ~ N (0, Ψ 1 2 ), γ n =2γ n-1 -γ n-2 +v n2 , v n2 ~ N (0, Ψ 2 2 ).
The models in Equations (2) and (3) can be expressed in a matrix-vector form as follows:

The Kalman Filter
The Kalman filter is a recursive algorithm that is used to find an optimal estimation of the state in a state-space model and to estimate time-varying random variables that cannot be observed based on a set of noisy measurements. There are two steps involved in the Kalman filter algorithm: prediction and filtering. In the prediction step, the Kalman filter provides the mean of the current state variables and the covariance of the predictive error. Filtering incorporates the new measurement at the corresponding time point into the prior information that is obtained in the prediction step to obtain an improved posterior distribution for the present state [17,18,19]. However, before using the Kalman filter, we need to construct a state-space model to enable a state to be estimated. Generally, a state-space model involves a state (or system) equation and a measurement (or observation) equation [20]. Consider the dynamic system as follows: x n = F n x n-1 +G n v n (state equation), y n = H n x n +w n (measurement equation), where, x n is the state vector (object of estimation), y n is the observable time series, v n~ N(0, Q n ) is the system noise, w n~N (0, R n ) is the observation noise, and F n , G n , and H n are the coefficient matrices. The system expressed in Equations (7) and (8) is called the state-space model. It can be seen that the model in Equations (5) and (6) is equivalent to the statespace model in Equations (7) and (8) if we set x n = [ a n a n-1 γ n γ n-1 ] T , Q n =diag.(Ψ 1 2 , Ψ 2 2 ), and R n =σ 2 and construct appropriate coefficient matrices F n , G n , and H n .
One of the features of the state-space modeling approach is that information related to past processes is merged into the current state. This is usually called a Markovian property [21]. Figure 4 shows a block diagram of the state estimation process for a dynamic system that is expressed as a statespace model [22]. The Kalman filter algorithm is given by Equations (9)- (13), where x n|n-1 denotes the mean of the state vector at n given observations up to time point n-1, e V n|n-1 denotes the corresponding covariance matrix, and so on. For a set of observations Y 1:N = {y 1 , y 2 , …, y N }, we can obtain a set of estimates for the state by pursuing the Kalman filter for n = 1, 2, …, N − 1, N. Note that the Kalman filter starts from initial values of x 0|0 and V 0|0 , which are provided in advance.
Prediction step: x n|n-1 = F n x n-1|n-1 Vn|n-1=FnVn-1|n-1FnT+GnQnGnT Filtering step of the Kalman gain equation: K n = V n|n-1 H n T (H n V n|n-1 H n T +R n ) -1 Update step: x n|n =x n|n-1 +K n (y n -H n x n|n-1 ) V n|n =(I-K n H n )V n|n-1 (13) Another aspect of inference based on the state-space model is the smoothing step. Based on data Y 1:N ={y 1 , y 2 , …, y n } collected over a fixed time period {1, 2,..., N}, smoothing attempts to find the posterior distribution of the state x n conditional on Y 1:N for any n ∈ {1, 2,..., N}. For linear Gaussian state-space models, this can be done precisely using the Kalman smoother, which consists of a Kalman filter plus subsequent recursive "backward smoothing" for n = (N, N−1,…, 1) [23]. This is also called fixed-interval smoothing. The formula for fixed-interval smoothing is as follows [17]: However, when some elements in the matrices F n , G n , H n , Q n , and R n are unknown parameters, it is necessary to estimate them in advance. Let θ denote the vector of the unknown parameters. In the model in Equations (5) and (6), θ contains the parameters σ², Ψ 1 2 , and Ψ 2 2 . Based on the Kalman filter predictive distribution of the time series, y n can be obtained with y n|n-1 and U n|n-1 denoting the mean and the covariance matrix, respectively. At time n, these can be calculated based on the results of the Kalman filter as follows: y n|n-1 = H n x n|-1 U n|n-1 = H n V n|n-1 +R n .
From the Kalman filter algorithm, we can see that the results of the Kalman filter depend on the parameters θ, hence y n|n-1 and U n|n-1 also depend on θ. Thus, for given values of θ, the density of the predictive distribution for y n is given by Based on this density, the likelihood function of θ can be defined by L(θ)= f(Y 1:N |θ) = f n (y n |Y 1:(n-1) , θ), where the time-series data Y 1:(n-1) = {y 1 , y 2 , …, y n-1 }, and so on. This likelihood function will generally be a complex nonlinear function of the parameters θ, and thus the estimates for the parameters θ can be obtained by maximizing the likelihood function in Eq. (14) numerically with respect to θ [23,24].  2 3.35*10 Ψ2 2 9.12*10 σ² 1.14*10 Log likelihood (goodness of fit) 30.86 The panel in Table 2 shows the results of the estimation of the state-space model using the Kalman filter algorithm. In particular, Ψ 1 2 and Ψ 2 2 are the estimates for variances in the system noise, and σ² represents the variance in the observation noise. The upper panel in Figure 5 shows the estimates (mean) for the technology factor (A n = exp(a n )) and the lower panel shows the estimates for planted area elasticity (γ n ). There is a continuous upward trend in the technology factor during the period, and it is eight times higher in 2017 than it was in 1961. This change in the technology factor has had a significant influence on productivity and yield in recent years.

Results
Conversely, planted area elasticity shows a significant downward trend, with values falling from around 1.04 in 1961 to around 0.92 in the early 2000s, reflecting the increase in the planted area. Since then, there has been a slight increase, with values rising to around 0.96 in 2017, which is not significant compared with the values seen in previous decades, and is related to the decrease in the planted area. Productivity has not responded sensitively to changes in the planted area, and there is a crossover between both elasticities where the level of technology has increased and the planted area has decreased. Thus, improvements in agricultural technology have not been accompanied by agricultural expansion. Technological change has had a greater effect than the planted area on productivity.
Technological change elasticity is a time-varying indicator that changes positively over time. It is influenced by agricultural policies that contribute to diversifying and enhancing agricultural productivity [26,27]. Madagascar's fn(yn|Y1:(n-1), θ) agricultural policy is marked by national agricultural projects and reforms via technological support and fertilizer distribution to rice farmers during the post-independence period from the 1960s to the 1990s, followed by a global policy of economic liberalization [28,29,30]. In addition, there has been increased investment in technology diffusion in relation to agricultural development projects, mainly by international organizations, since the early 2000s [1,30,31]. The system of rice intensification technology was developed locally in the early 1990s, but was not widely adopted. It has since been readapted in the context of agroecology, or smart agriculture for an improved rice intensification system [32,33,34]. A combination of these socio-agroeconomic policies has resulted in a gradual transformation in Madagascar's agricultural sector, although it will take time to fully evolve.
Meanwhile, the rice planted area is influenced by a lack of investment in irrigation infrastructure, vulnerability to climate change and extreme weather events such as cyclones, drought and lack of security in terms of land tenure [30,35,36]. In addition, the system of land transfers between generations through inheritance has become inefficient, as the average area of land per farmer has decreased from 1.2 hectares in 1985 to 0.25 hectares in 2016 as the rural population has increased [37,38].

Conclusion
In the context of a population explosion and a vision of economic development, increasing agricultural productivity is a challenge that Madagascar must meet if it is to ensure food security. The demand for rice is likely to increase in the future, and thus evaluating the current state of rice productivity is crucial to implementing improved agricultural policies and practices.
In this study, we estimated the technology factor and planted area elasticities based on data for rice production and the rice planted area in Madagascar during the period from 1961 to 2017 using a state-space modeling approach. Using recursive prediction and updating, we obtained estimates for the technology factor and planted area elasticities using a set of optimal algorithms with minimum error and time-varying indicators.
The estimates for variances in system noise showed that the proposed model is well-fitted to the data. There is a significant upward trend in technology factor elasticity, with values rising from 1 to 8 during the study period, while, while the planted area elasticity values fluctuate between 0 and 1, decreasing during the period from 1961 to 2000 before increasing slightly from 2007 to 2017. These results show that technological change has had a greater effect on productivity than rice planted area. In addition, our hypotheses are supported. Importantly, these findings are helpful for decision-makers aiming to develop strategies to support ongoing technological improvement and also increase the rice planted area to enhance rice productivity in Madagascar.