1 Introduction

In accordance with the Paris Declaration on Aid Effectiveness in 2005, recipient countries of aid were encouraged to improve their aid management systems with the aim of increasing their effectiveness. According to Knack (2013), a good aid management system has a positive relationship with donor reputation, system trust, and the emergence of strong public support in donor countries. While aid can have a positive impact on economic development in developing countries, it is important to consider the political interests of each donor (Gu et al. 2022; Li 2021). Aid, on the other hand, is distributed based on the needs of recipient countries, donor interests (Hoeffler and Outram 2011), and altruism considerations (Berthélemy 2006). However, it is not uncommon for such aid to impose financial burdens on recipient countries.

The aid-corruption paradox highlights corruption as a double-edged sword, by impeding the effectiveness of aid and providing a chance for reform (Bauhr et al. 2013). Controlling corruption is crucial as it often leads to inefficiency (Maqbool and Ali 2021). International organizations have made anti-corruption efforts a requirement for receiving aid (Ferry et al. 2020). Meanwhile, Indonesia's foreign aid remains stable despite an increase in the corruption index. The rising corruption levels in Indonesia are becoming a cause for concern and raise doubts about their impact on the stability of foreign aid in the country. The rise in the corruption index is depicted in Fig. 1 and shows a consistent increase from 2000 to 2021, resulting in more than double result since 2000.

Fig. 1
figure 1

Indonesian corruption index, 2000–2021

The anomaly between foreign aid and corruption is consistent with the research conducted by Acht et al. (2015), which found that the quality of governance in recipient countries does not affect the amount distributed by donors. According to Dávid-Barrett et al. (2020), there is limited evidence on how to effectively control corruption in development aid. Therefore, this perspective aligns with the situation in Indonesia. Efforts to curb corruption through the legal system have significantly increased.

The data from the Ministry of Finance indicate that in Indonesia, foreign aid is dispersed across multiple sectors by various bilateral and multilateral donors, with the government taking into account the region as a factor. However, corruption practices at the regional level raise concerns about the sustainability of foreign aid. To address this, the authors aim to predict the long-term viability of foreign aid in Indonesia based on international perceptions of corruption and corruption cases in the country. This study compares three techniques for modeling foreign aid and corruption indicators, namely artificial neural network (ANN), multiple linear regression (MLR), and time series vector autoregression (VAR). Furthermore, good governance in the recipient country should be considered in the aid distribution mechanism, and view corruption as the main obstacle to the continuity of foreign aid. The use of ANN offers a broader perspective and aims to provide robust prediction results.

In this study, a logarithmic backpropagation neural network (BPNN) is employed to estimate the model using an artificial neural network (ANN). ANN is a mathematical model composed of interconnected neurons that process input data via computing-based connections (Shiau et al. 2022). As a popular non-parametric statistical model alternative, ANNs have been known to produce better results compared to traditional regression models in various fields including economics and finance (Kumar et al. 2015; Stangierski et al. 2019; Herbrich et al. 1999). The application ANN is more prevalent in engineering and computer science due to its high coefficient of determination (Charandabi and Kamyar 2021; Ramos et al. 2020). Therefore, this study aims to provide an alternative estimation method for economic studies, particularly those related to foreign aid and corruption, by using the ANN technique.

The study is structured as follows, Sect. 2 provides a literature review, while 3 explains the methodology. Furthermore, Sect. 4 presents the findings and discussions, and Sect. 5 provides the conclusion.

2 Literature review

2.1 Foreign Aid and Corruption

The issue of governance quality has been a concern for bilateral donors since the nineteenth century (Berthélemy and Tichit 2004). The connection between foreign aid and corruption has garnered global attention, resulting in efforts to eradicate corruption in developing countries through international cooperation (Knack and Keefer 1995; Treisman 2007; Menard and Weill 2016). This has led to differences in aid allocation among donors, with Japan providing aid to corrupt countries while Canada and Sweden prioritize countries with better governance (Neumayer 2003). Despite clean governance being a requirement for receiving aid, corrupt donors may not enforce anti-corruption mandates (Ferry et al. 2020). Game theory simulation shows that corruption level affects aid allocation, with higher results leading to better aid (Kemp and Long 2009). Studies have found a correlation between windfalls, foreign aid, and higher corruption in countries with weaker governance (Svensson 2000). However, research in African countries using GMM and quantile regression show that aid in the form of infrastructure development, and multi-sector programs consistently reduces corruption (Efobi et al. 2019).

The distribution of aid in several countries can be surprising, according to a study by Isaksson and Kotsadam (2018), who found that China's aid to Africa appears larger than the World Bank's. This aid, while fueling corruption at the local level, has to show any short-term impact. Meanwhile, evidence of local corruption can be seen in ongoing Chinese projects. A study conducted by Ali et al. (2019) in Asia assessed the effect of foreign aid on corruption in Bangladesh, India, Pakistan, and Sri Lanka using dynamic ordinary least squares (DOLS) and fully modified ordinary square (FMOLS) panels. The result showed that foreign aid can reduce corruption perception in these countries, but corrupt practices can still persist in its implementation. Aid can help boost economies in low- and middle-income countries, but institutional strengthening is also needed to prevent corruption (Wang 2022). Furthermore, donor countries' efforts to aid developing nations can also positively impact their image (An and Feng 2022; Liu 2022). Li (2021) concluded that Chinese aid to African countries will be more effective when the US does not provide concurrent aid. Therefore, political ideology also plays a crucial role in government policies (Wulansari 2021).

The relationship between aid and corruption remains a global concern and topic of debate, with various approaches attempted in studies to understand their relationship and potential causality. Therefore, this study aims to fill the gap in the literature by exploring the use of artificial neural networks in the field of foreign aid and corruption.

2.2 ANN and Economic Analysis

An artificial neural network (ANN) is a mathematical model that has proven to be effective in classifying time series data and solving non-linear problems due to its parallel structure (Stangierski et al. 2019; Tsakiri et al. 2018). It mimics the performance of the human brain and is based on the mathematical model of the biological neural network (Ahmad et al. 2014). The model works by processing information on neurons, connecting signals between neurons through a network with associated weights, and using activation functions to generate output (Chiroma et al. 2017).

In recent years, the application of machine learning models like ANN has gained significant attention in various fields, including economics (Nosratabadi et al. 2020). One popular variant of ANN is the backpropagation neural network (BPNN), which has been used in several studies, such as predicting aquatic product exports (Zhang 2019). This study highlights the benefits of using e-commerce sales data with ANN in building large historical datasets and generating accurate predictions in a shorter time frame.

In addition to sales data, ANN can also be used to predict gross domestic product (GDP) and other economic factors. Chuku et al. (2019) conducted a study to compare the performance of ANN, ARIMA, and structural econometric models in forecasting GDP in South Africa. The result showed that ANN outperformed the other models, providing better results when inputs such as commodity prices, international trade, inflation, and interest rates were considered.

A study by Sokolov-Mladenović et al. (2016) compared the use of backpropagation neural network (BPNN) and extreme learning machine (ELM) in predicting economic growth using trade data, exports and imports of goods and services, as well as merchandise trade. The results showed that ELM had more effective prediction results than BPNN. However, Feng and Zhang (2014) reported that ANN was more efficient and produced better results than conventional models in forecasting economic growth in China.

Based on these findings, it can be inferred that ANN has the potential to produce improved predictions compared to conventional models. To the best of our knowledge, no previous study has applied ANN to predict foreign aid based on perceived corruption factors. Therefore, this study aims to use ANN with a backpropagation algorithm to forecast Indonesia's foreign aid.

3 Methodology

This study uses data obtained from secondary sources. Grants and loans data are sourced from the Government Loans and Grants Report published by the Directorate of Loans and Grants—Directorate General of Debt Management—Ministry of Finance of the Republic of Indonesia for the semester I of 2011 to 4 of 2021. Meanwhile, Corruption Perception Index (CPI) data for the period of 2012 to 2021 are acquired from www.tranparency.org. Control of Corruption (CC) and Voice and Accountability (VA) are data obtained from World Governance Indicators that can be accessed at http://info.worldbank.org/governance/wgi/. The CC and VA data collected are from 2012 to 2021. In addition, gratifications and public complaints (PC) are taken from Komisi Pemberantasan Korupsi Republik Indonesia (KPK RI: Commission of Eradication Corruption of the Republic of Indonesia) reports of 2012–2021. CPI, CC, and VA are represented as international corruption perceptions, while gratification and PC are used as a proxy of the cases in Indonesia. In addition, data from the macroeconomic aspect, such as Gross Domestic Product per capita (GDP per capita) (Tezanos et al. 2013), poverty, and Gini Index (Kabir 2020), are obtained from the World Bank.

Since data for the grants and loans are not balanced, quarterly interpolation was created by performing an augmented dataset for processing data until 235 series as well as applied to 195 for training and 40 for validation, respectively. The number of validation and test data is equal to the actual result obtained. Several steps formally used in this method are considered to process data in the artificial neural network. The following are the stages taken, apply the sigmoid binary activation function, use the backpropagation method, design network architecture, make an input and output initialization, build artificial neural network architecture, analyze mean square of error (MSE), and check coefficient determination. MATLAB and R are used to achieve the aim of this study, and Fig. 2 shows a network architecture.

Fig. 2
figure 2

Network architecture

First, the binary sigmoid activation function has a value interval of 0 to 1, and it is commonly used in an artificial neural network. To get the output value from 0 to 1, binary sigmoid is crucial to apply in this method. The sigmoid function is formulated by y=f(x)=1/(1 + exp⁡(-α x)), while the step function is expressed by y' (x)=σ f(x)[1-f(x)]. Consequently, all the data were converted to the binary sigmoid.

Second, backpropagation is supervised learning operated by a perceptron with many layers to amend weights and have a relation to neurons in the hidden layers. In this study, back-forward propagation is implemented and Levenberg–Marquardt is employed for the training algorithm. Third, the network architecture of backpropagation, and this study establishes three layers, namely input, hidden, and output. The input layer contains the unit of input variables. The hidden layer consists of five attempts of the neuron, namely 10, 12, 14, 16, and 18, to reach a robust result with the output layer of one neuron. The fifth step is initialization input, involving CPI, CC, VA, Gratification, and PC variables, while the sixth is the initialization output. There is only one output on each attempt in this study, which is grants and loans.

The seventh step is the architecture of an artificial neural network. The architecture used to predict the grants and loans employs a multilayer net. Furthermore, 5 architectures are adopted for getting robust by using the convergence of trials. The eighth step is MSE, and the general equation is \(\mathrm{MSE}=\frac{\sum_{i=1}^{n}{e}_{i}^{2}}{n}\). \({e}_{i}^{2}\) is the gap between the target and predicted values, and \(n\) is the number of learning. Finally, coefficient of determination is calculated by this formula (Render et al. 2003). SSR and SSE are a sum of squares due to regression and error. \(\mathrm{SST}\) is the sum squares of the total, while \(\widehat{Y}\), \(\overline{Y }\), and \(Y\) are the prediction, the mean of actual data, and the actual data. Figure 2 is the architecture of the artificial neural network in this study.

$${r}^{2}=\frac{\mathrm{SSR}}{\mathrm{SST}}=1-\frac{\mathrm{SSE}}{\mathrm{SST}}$$
$$\mathrm{SSR}=\sum {\left(\widehat{Y}-\overline{Y }\right)}^{2}$$
$$\mathrm{SST}=\mathrm{SSR}+\mathrm{SSE}$$

This study compares the ANN estimation results with MLR and VAR in addition to the ANN model. The MLR equation is specified as a linear logarithmic function in the form of a parametric persistent elasticity function (Bianco et al. 2014; Shiau et al. 2022), as seen in the following equation:

$${\mathrm{lnGrants}}_{t}=\;\alpha +{\beta }_{1}{\mathrm{lnCC}}_{t}+{\beta }_{2}{\mathrm{lnPC}}_{t}+{\beta }_{3}{\mathrm{lnVA}}_{t}+{\beta }_{4}{\mathrm{lnCPI}}_{t}+{\beta }_{5}{\mathrm{lngrat}}_{t}+{\beta }_{6}{\mathrm{lnGDPcap}}_{t}+{\beta }_{7}{\mathrm{lngini}}_{t}+{\beta }_{8}{\mathrm{lnpov}}_{t}+{\mathrm{e}}_{t}$$
$${\mathrm{lnLoans}}_{\mathrm{t}}=\;\alpha +{\beta }_{1}{\mathrm{lnCC}}_{t}+{\beta }_{2}{\mathrm{lnPC}}_{t}+{\beta }_{3}{\mathrm{lnVA}}_{t}+{\beta }_{4}{\mathrm{lnCPI}}_{t}+{\beta }_{5}{\mathrm{lngrat}}_{t}+{\beta }_{6}{\mathrm{lnGDPcap}}_{t}+{\beta }_{7}{\mathrm{lngini}}_{t}+{\beta }_{8}{\mathrm{lnpov}}_{t}+{\mathrm{e}}_{t}$$

4 Result and Discussion

In this study, the backpropagation method is employed to evaluate the effectiveness of the neural network system. The process involves two stages, namely initialization, and training. During the initialization stage, eight input nodes are provided. The optimal number of hidden layers is determined through trial and error by adjusting the learning constants and hidden layers until the best configuration is achieved, which is the smallest number of epochs. Meanwhile, different hidden layer configurations were tested. The output layer consists of one node, representing either grants or loans. The learning rate used was 0.5, with a maximum error and epoch of 0.001 and 1000. The network was trained using the Levenberg–Marquardt function, and the performance was measured using the mean squared error (MSE) with a value of 0.001.

In the training phase (see Fig. 3), 235 data points were utilized and processed through a binary sigmoid activation function. During the testing stage, the number of data points was adjusted based on further experiments, with 40 each for validation and testing. This was conducted to provide a more accurate prediction, considering that the original sample size was 40 data points. The network was trained using the trainlm function. The optimal configuration for training grants data was 8–18–1 with 156 epochs and 162 iterations, with an MSE value below the target. For training loan data, the best configuration was 5–18–1 with 381 epochs and 387 iterations, also with an MSE value below the target.

Fig. 3
figure 3

Data training distribution

To produce the best configuration, estimation is carried out with various architectures. These architectures have been described in the previous section, as presented in Tables 1 and 2.

Table 1 The training value of grants
Table 2 The training value of loans

Based on the test results, it is concluded that predicting aid using the backpropagation algorithm with architectural variations is accurate. In the case of grants prediction, the E architecture of 8–18–1 is the best configuration because it has the smallest MSE and the highest R-value with an epoch of 156. The 8–18–1 configuration is the best forecasting architecture model, as shown in Table 1 and Fig. 4.

Fig. 4
figure 4

Best performance

In Table 2 in the case of loans, the best architecture is C, which is 8–14–1. The results of the architectural model have the smallest MSE value. In addition, the R-value in the configuration model is the highest, and the epoch is also relatively small with few iterations. Based on the theory, the model with the smallest MSE value is considered, as shown in Fig. 4.

In addition to the regression results for each aid component, show in Figs. 5 and 6, some results of prediction values and future forecasts for foreign aid are also presented on the next figure. Figure 7 shows the actual and prediction value, and the same is true for forecasts in future.

Fig. 5
figure 5

Regression result of grants

Fig. 6
figure 6

Regression result of loans

Fig. 7
figure 7

Actual vs prediction

The results in Figs. 5 and 6 suggest that the training is considered successful because the correlation is close to 1, indicating a high match between the input and the target. This confirms previous research that corruption plays a role in foreign aid provision (Ferry et al. 2020), but contradicts the findings of Acht et al. (2015) and Dávid-Barrett et al. (2020) who argued that its influence is not significant. According to Menard and Weill (2016), corruption affects aid, but not significantly. The analysis of foreign aid is interesting because it aligns with (Neumayer 2003), who noted the significant presence of Japanese dominance in the country.

In the simulation training for foreign aid, which includes grant and loan simulations, several variables were used as input data, including the Corruption Perception Index (CPI) as a proxy for corruption, control and voice of accountability as indicators of good governance, cases of gratification and public complaints against corruption, and macro-indicators. The use of CPI was intended to examine when donors consider high corruption rates in Indonesia.

Figure 7 depicts that the predicted and actual values follow the same pattern. It means that the accuracy of the E architecture is precise in predicting the value of aid. In addition, 5 architectures were simulated to forecast patterns for the next ten years. Figure 8 shows that there will be a similar pattern of aid to the previous ten years. Meanwhile, architecture with the same pattern is owned by D and E, both for grants and loans.

Fig. 8
figure 8

Forecasting for the next ten years

This study uses ANN to calculate the relative importance of grants and loans based on the best models obtained from architectures E and C. The gratification variable is found to be the most important factor influencing grants and loans, as shown in Fig. 9, followed by GDP per capita and VA, respectively. Meanwhile, the poverty variable and CPI have a lower relative importance value, indicating the significance in shaping the ANN architecture. To evaluate the ANN estimation results, the study compares the model with linear and VAR models using time series data, as shown in Table 3. The results indicate that ANN outperforms the other models in terms of modeling and prediction accuracy, with higher R-squared values of 0.962 and 0.991 for grants and loans and lower MSE values of 0.0008 and 0.0011. These findings align with previous studies, including Bilgili et al. (2012), where ANN is more effective than linear and non-linear regression in modeling demand, and Azadeh et al. (2008) who concluded that the concept is better than ANOVA in demand prediction. Additionally, recent studies by Shiau et al. (2022) and Adha and Hong (2021) showed that backpropagation neural networks can predict economic demand models effectively.

Fig. 9
figure 9

Relative importance variable

Table 3 Parameter estimates

The parameter estimation results in Table 3 show that ANN outperforms MLR and VAR. As previously stated, the estimation of the relative importance of the variable shows that gratification is the most important factor influencing international aid. The high index influencing foreign aid sustainability should be a major source of concern for the Indonesian government. This is because political gratification, which is a component of corruption, ruins international trust in a country's government system.

The findings show that a corrupt government, particularly one with a high level of political gratification, can have an impact on foreign aid. These differ from the results of Alesina and Weder (2002), where a corrupt government did not affect the amount of foreign aid received by the country. An Easterly (2007) study found that a corrupt government received more aid. According to a recent study by Acht et al. (2015), donor countries use different aid channels to differentiate between recipients with good and poor governance. As a result, countries with good governance can receive more aid.

Using partial dependence plots, this study investigates the relationship between input variables and predictions (PDP), and Figs. 10 and 11 show the results of the PDP estimation. According to the PDP for grants, PC has a positive relationship with grants, while CPI, CC, VA, and Grat have a negative relationship. Figure 11 depicts a slightly different relationship in the PDP for the loan variable. The Gini ratio and the poverty variable show a negative relationship with loans, while others indicate a positive relationship.

Fig. 10
figure 10

Partial dependence plot for grants

Fig. 11
figure 11

Partial dependence plot for loans

5 Conclusion

This study predicts the long-term viability of foreign aid based on international perceptions of corruption and criminal offense in Indonesia. To forecast foreign aid, an artificial neural network analysis (ANN) is used with the backpropagation method. Subsequently, several estimation techniques are compared, including the linear model and VAR. By constructing these comparisons, the estimation results from the ANN can be compared with other models, to broaden the direction made. Using a modified neural network array, several architectural models to estimate the input variables have been created.

The best architectural model for predicting grants and loans is architectures E and C, which can reliably anticipate foreign aid. From these findings, views of worldwide corruption, efforts to combat corruption, and the sustainability of foreign aid have a substantial correlation. Accordingly, Indonesia demands effective governance to preserve foreign aid. Therefore, government regulations and distribution mechanisms should be more effective and targeted. The central and the local government should be able to plug corruption loopholes into the aid mechanism.

The estimation, linear regression, and VAR show that ANN has better results than other models in terms of coefficient of determination and MSE. The coefficient of determination produced is greater than MLR and VAR, while the MSE value is lower. Furthermore, calculating the importance variable on the ANN shows that the gratification variable is the most important in the proposed model.

This study does indeed have drawbacks due to the supporting literature and methods. The purpose of future analysis will be to investigate the causality of the corruption-aid conundrum in Indonesia.