Comparison Methods of Machine Learning and Deep Learning to Forecast The GDP of Indonesia

The success of an economy can bring significant benefits to a country and its society. One way to measure economic growth is by looking at the value of gross domestic product (GDP). The value of a country's GDP is influenced by many factors, including inflation, exports, and imports. Therefore, predicting future economic growth requires forecasting the value of GDP. GDP forecasts are crucial as they provide information about the economic development of a country over a specific period of time. By forecasting GDP, governments and investors can make informed decisions to optimize profits or minimize risks when investing or doing business in a country. This research aims to forecast Indonesia's GDP for the second, third, and fourth quarters of 2023 using the best models from machine learning or deep learning methods. Forecasts are made for each method with and without additional variables. The results indicate that the SimpleRNN algorithm from deep learning without additional variables is the method with the smallest RMSE and MAPE for GDP forecasting. Therefore, the best method used to forecast GDP is the SimpleRNN algorithm, and the forecasted GDP values for Indonesia's second, third, and fourth quarters are 5.350.840, 5.483.895 and 5.610.077 billion rupiah.


Introduction
Economic success can bring significant benefits to a country and its society.Positive economic growth is expected to boost welfare and reduce poverty levels significantly (Ginting & Dewi, 2013;Pribadi & Kartiasih, 2020;Belantika et al., 2023).The macroeconomic approach judges a country's success based on a variety of indicators, including its economic growth rate.Therefore, it is not surprising that economic growth is one of the main objectives in the economic sphere.Economic growth reflects the health and economic strength of a country, and can affect the lives of society at large (Kartiasih & Setiawan, 2020).In addition, stable and significant economic growth can drive investment and consumption, create jobs, increase public income and well-being, and reduce poverty.
Examining a nation's Gross Domestic Product (GDP) level is one technique to gauge economic development.The gross domestic product (GDP), which is often measured over a single year, is the sum of the value of all products and services generated in a nation.An increase in the GDP of an economy reflects a positive picture because it shows a better economic position, so every country tries to maximize the GDP growth rate (Divya & Devi, 2014).If a country's GDP value increases from year to year, it can be said that the country is experiencing economic growth.Stable and positive economic growth can have a positive impact on people's quality of life, including increased income, increased employment, and improved access to public services.
A country's Gross Domestic Product (GDP) is affected by many factors, including inflation, exports and imports.Inflation is an increase in the price of goods and services that results in a decrease in people's purchasing power and increases production costs.If inflation increases, the price of goods and services in the country increases and this causes the value of real GDP to decrease (Silitonga, 2021).Therefore, price stability is important in maintaining stable economic growth.On the other hand, exports and imports can also affect a country's GDP as they are both sources of income from international trade.The profits a country makes when exporting goods or services can be used to make imports that can trigger the country's economic growth (Sudarmawan, 2022).If a country is able to increase its export volume or reduce its dependence on imports, it can increase its GDP.Therefore, to increase GDP, countries need to make various efforts such as maintaining price stability, increasing export volume, and creating policies conducive to investment and public consumption (Adwendi & Kartiasih, 2016;Kartiasih, 2019a).By optimizing the factors that contribute to GDP, it is expected that a country can achieve stable and sustainable economic growth.
There is currently an issue of concern regarding the threat of a global recession in 2023.According to Guenette et al. (2022), the world's three largest economies the United States, China, and Europe are experiencing significant economic slowdown conditions whose impact could spread to other countries and cause wider pressure on the global economy.If the global economy experiences further pressures, such as a more severe slowdown or adverse external factors such as trade tensions, financial market fluctuations, or changes in economic policy, the global economy could go into recession.In this situation, preventive measures and economic stimulus could be important to maintain global economic growth and stability.
Governments and economic institutions play a role in managing and responding to potential economic threats.Efforts to maintain a stable GDP involve sound policies, careful economic planning, effective supervision and regulation, and appropriate risk management.Before developing effective economic policies, it is necessary to forecast the state of the Indonesian economy in 2023.GDP forecasting is important in providing information about a country's economic development.In addition, by predicting GDP, investors and business people can make the right decisions to optimize profits or minimize risks in investing or doing business.Thus, this research aims to forecast Indonesia's GDP in the second, third, and fourth quarters using the best model from machine learning or deep learning methods.
The use of the method used in this research is motivated by research gaps from several studies that have been conducted previously.The first is research by Yoon (2020) which aims to forecast Japan's GDP growth with a machine learning approach.The second is research by Tkacz & Hu (1999) which aims to forecast Canadian GDP using the Artificial Neural Networks method by including financial and monetary variables.The third is research by Maccarone et al. (2021) which aims to compare the results of forecasting US GDP using the K-Nearest Neighbor method and traditional time series analysis.The difference between this research and several previous studies is the use of the XGBoost, Random Forest, Recurrent Neural Network, and deep learning methods and includes additional variables in the form of Indonesia's inflation and import-export figures.

GDP
The total value of the finished products produced by all firms functioning in a nation during a given period of time is known as the gross domestic product (GDP).It includes the entire value added through domestic production activities.As a result, GDP is a crucial indicator for assessing a country's economic development.It includes both products and services that are based on the market as well as other non-market activities, such defence or educational services that are offered by the government (Callen, 2022).
GDP is commonly employed for comparing economic performance across countries, although its original purpose did not include assessing living standards, progress, or social welfare (Tjukanov, 2011).Nevertheless, these comparisons are often extended to gain insights into living standards, progress, or social welfare between countries.While GDP cannot provide a detailed assessment of people's quality of life, it is a widely accepted measure of a country's economic level worldwide (OECD, 2016).GDP can give an indication of the size of an economy, but it does not provide information on income distribution or overall well-being (Kartiasih, 2019b;Kusumasari & Kartiasih, 2017).Therefore, it is important to use other indicators such as the human development index to evaluate social welfare and people's quality of life.While GDP has weaknesses in evaluating people's well-being, it is still an important indicator in comparing the economic performance of countries or regions.
GDP data is presented in a monthly report released by BPS.The report contains information on the value of GDP generated in Indonesia over the past month.The BPS GDP monthly report is used as one of the indicators of Indonesia's economic performance.The data provides an overview of Indonesia's economic growth and the contribution of each economic sector to that growth.In addition, monthly GDP data is also used as a reference by the government in formulating appropriate economic policies to improve Indonesia's economic performance and encourage better economic growth in the future.In calculating the value of GDP, three approaches can be taken, namely the production, income, and expenditure approaches.

Inflation
According to Suparmoko (2000), inflation referred to in economics is the process of increasing prices in general and continuously.Inflation can result from a variety of factors, including increased public demand, excessive market liquidity that encourages spending or speculation, and uneven distribution of products.BPS describes inflation as a general increase in the price of services and goods for the people's basic needs or a decrease in the value of a country's currency.inflation can also be interpreted as an excess demand for goods and a lack of overall production of goods in an economy.
From the description above, it can be concluded that inflation covers several aspects including (i) Tendency, general price increase trend; (ii) Sustained, prices of goods and services increase in the long term continuously; and (iii) General level of price, the price increase in mind is the general price.Based on its origin, inflation can be divided into two, namely inflation from within the country and inflation from abroad.Inflation that originates domestically is an increase in the price of goods due to the pressure of macro variables from within the country.Meanwhile, inflation that comes from abroad is a situation in another country that causes an increase in domestic prices.This situation can be in the form of an increase in the price of goods exported by the country (Santosa, 2017).

Export-Import
According to Mey Risa (2018), Export is the trade by removing or sending goods from within the customs territory outside the territory of a country.There are direct and indirect benefits from the trade.The direct benefit is to increase domestic production so that the country can obtain greater national income and will increase the rate of economic growth.With the growth of the economy, it will open up jobs and improve the welfare of the community.In addition, trading goods abroad will also expand the sales market.The output of goods may not be fully absorbed by the domestic market alone, so new markets are needed to absorb the output.Trading abroad will also improve cooperative relations between countries.
On the other hand, import is the activity of bringing goods from outside the customs area into the territory of a country (Berata, 2014).In the opposite direction to exports, an increase in the number of imports will reduce national income.Incoming goods require an outflow of money to pay for them so that national income will decrease (Hawari & Kartiasih, 2017;Ningsih & Kartiasih, 2019).However, imports are important for a country.Not all countries can meet all their own needs from domestic production.The imbalance between production and demand will lead to scarcity and price hike problems if not resolved.Therefore, the state imports goods that cannot be fulfilled independently.However, the country also needs to consider limiting the amount of imported goods so that the balance of payments does not have a significant decline.

Deep Learning
Deng & Yu (2014) in their book entitled Deep Learning: Methods and Applications listed several definitions of deep learning, including (i) A subsection of machine learning methods that utilizes multilayered nonlinear information processing to analyzing and classifying either for supervised or unsupervised learning; (ii) Deep learning is a discipline that focuses on learning several layers of representation and abstraction in order to comprehend input like images, sounds, and text.
Deep learning is a subset of machine learning that utilizes neural networks with multiple layers.It offers several advantages, such as eliminating the need for time-consuming feature engineering and replacing "shallow" processing models used in traditional learning.Moreover, deep learning has overcome barriers between different application areas like computer vision, speech recognition, natural language processing, and medical informatics.This is achieved by replacing domain-specific preprocessing methods and providing a unified toolbox to address various problems (Zhang et al., 2021).
Deep learning is a representation technique that produces many levels of representation by combining a number of simple but non-linear modules.Each module in deep learning transforms the data representation from a lower level (starting from the raw data) to a higher and slightly more abstract The layers of modules analyze the data in a predetermined order so that a module always analyzes the representation of a particular layer.The more module processes performed, the more abstract the data becomes but the more comprehensible it is to a machine or computer.

Recurrent Neural Network
Recurrent Neural Network (RNN) is a modified neural network to process data using recurrence connections.RNN is very well used in making predictions for sequential data and is often used in natural language processing (Hewamalage et al., 2020).The use of the RNN algorithm also shows good results when used on time series data (Guo et al., 2016).In RNN, each neuron will add inputs derived from previous data.The network can now recognize temporal links and patterns in the data as a result.Each neuron's output is also looped back on itself, allowing the network to store information over time.
According to Priyanka et al. (2021), RNN simple layer is used to model the full connection between units in the network.RNN simple layer accepts the following parameters: 1. Number of units: The number of units or neurons to be employed in the RNN simple layer is determined by this parameter.The intricacy of the model and the network's capacity to recognize patterns in sequential data are both governed by the number of units.2. Input form: This option sets the type of input data that the RNN simple layer will accept.It includes details on the amount of features (input features) in each time step as well as the number of time steps in the sequential data.

Input features: This parameter refers to the number of features (input features) present in each time
of the sequential data.This is important for determining the input dimensions for the RNN simple layer.
We continued using the dropout layer after the Simple RNN layer.The RNN model's overfitting issue is solved by the dropout layer.Dropout forces the network to learn more broadly and lessen its reliance on each individual unit by randomly deactivating a subset of the units at each training time step.This lessens overfitting and enhances the generalizability of the model.The "vanishing gradient" problem, which restricts simple RNN's capacity to capture long-term dependencies, is its disadvantage.Due to this issue, more sophisticated recurrent architectures have been created, like the LSTM (Long Short-Term Memory) and GRU (Gated Recurrent Unit), which solve the vanishing gradient issue and offer enhanced performance.

Long-Short Term Memory
As stated by Van Houdt et al. (2020), the LSTM (Long Short-Term Memory) model is a resilient type of recurrent neural network architecture developed to address the challenge of the vanishing or exploding gradient problem.This problem often occurs when attempting to capture long-term dependencies, even when the time lag between relevant events is significantly long.The LSTM architecture tackles this issue effectively.It comprises interconnected memory blocks that form recurrent connections within the network.These memory blocks enable the LSTM model to retain and utilize information over extended periods, facilitating the handling of long-term dependencies in the data.
The general LSTM architecture consists of: 1. Block input: The block input step is devoted to updating the block input component that combines the current input x(t) and the output of the LSTM unit y(t-1) in the last iteration.2. Input gate: In this step, the Input Gate is updated by combining the current input x(t), the output of the LSTM unit y(t-1) and the cell value c(t-1) in the last iteration.3. Forget Gate: In this step, the LSTM unit determines which information should be removed from the previous cell state (c(t-1)).4. Cell: This step calculates the cell value that combines the Block Input z(t), Input Gate i(t) and Forget Gate value f(t), with the previous cell value.5. Output Gate: This step calculates the Output Gate that combines the current input x(t), the output of the LSTM unit y(t-1) and the cell value c(t-1) in the last iteration.

Machine Learning
Machine learning is a branch of computer science that focuses on creating computational algorithms that resemble human intelligence by learning from their environment (El Naqa & Murphy, 2015).According to Mohri et al. (2018), machine learning is a computer technique that uses historical data to improve performance and create accurate predictions.This historical data, which is frequently in electronic data format, provides experience for the learning model and is analyzed.Labeled training data or other types of data collected through interacting with the environment can be used.The efficiency of the predictions made by the learning model is significantly influenced by the precision and volume of this data.
There are various ways that machine learning can accomplish a task.Unsupervised learning, reinforcement learning, semi-supervised learning, and supervised learning are among the four.Supervised learning is a machine learning technique that involves establishing a relationship or mapping between a set of input variables (X) and output variables (Y).This learned mapping is then used to predict outputs for new, unseen data instances.Supervised learning holds significant importance in the field of machine learning and plays a central role in multimedia data processing (Cunningham et al., 2008).In supervised learning, the model is trained on a dataset comprising multiple input values (x) along with their corresponding output values (y).The objective is to develop a classifier or regressor that can accurately estimate output values for new input instances that have not been previously encountered (Van Engelen & Hoos, 2020).In general, supervised learning aims to classify data.If there are only two class categories, it is called binary classification.If there are more than two classes, it is called multiclass classification.If the data is classified in more than one class, it is called multilabel class (Putra, 2019).
Unsupervised learning focuses on how systems can learn to represent input patterns in a manner that captures the statistical structure of the entire set of input patterns.Unlike supervised learning or reinforcement learning, unsupervised learning does not involve having specific target outputs or evaluations associated with each input.Instead, unsupervised learning uses prior biases to determine what aspects of the input structure need to be found in the output (Dayan, 2015).Unsupervised learning models use only unlabeled training data and provide predictions for all unseen points.Generally, no examples are given in the labeled data.Therefore, evaluating model performance quantitatively becomes more difficult.Clustering and dimensionality reduction are examples of problems that are part of an unsupervised learning model.(Mohri et al., 2018).
A machine learning technique called semi-supervised learning uses both a large number of unlabeled instances and a limited number of examples that have been labeled (Brownlee, 2021).Semisupervised learning, according to Chapelle et al. (2006) and Zhu (2008) in Van Engelen & Hoos (2020), is a subfield of machine learning that combines supervised and unsupervised learning.Semi-supervised learning algorithms typically aim to enhance performance in one of these two tasks by making use of knowledge that is broadly linked to the other task.For instance, additional data points with unidentified labels might be employed to help with categorization when solving problems involving classification.This type of learning problem is challenging because both supervised and unsupervised learning algorithms are able to effectively utilize a combination of labeled and unexplained data.Thus, specialized semi-supervised learning algorithms are required.
Reinforcement learning is a science/method related to decision making.This method aims to learn optimal behavior in an environment with the goal of obtaining maximum benefits.This process of learning optimal behavior occurs through interaction with the environment and observation of the response, similar to how children explore the world around them and learn actions that help them achieve their goals (Verma & Diamantidis, 2021).

Time Series Analysis
Time series analysis is a specialized technique used to study data that was gathered over a predetermined time period and is referred to as time series data.Time series data can be used to examine how variables change over time, which distinguishes it from other types of data.Time is a key factor in time series analysis since it may be used to infer changes and overall trends that have been seen across different data points (Tableau, n.d.).
Time series data displays a wide variety of samples from several sectors.These include weekly interest rates, daily closing stock prices, monthly price indexes, and annual sales numbers in the business world.Time series data in meteorology includes hourly wind speeds, annual rainfall totals, daily high and low temperatures, and drought indices.Time series data are used in agriculture for tracking soil degradation, annual crop and livestock production, and export sales.Time series data is used in biology to record the heart's millisecond-level electrical activity, and in ecology to examine the diversity of animal species.
The main objectives of time series analysis can generally be categorized into two aspects.Firstly, it aims to comprehend or model the stochastic processes that underlie the observed time series data.This involves understanding the underlying mechanisms and patterns that generate the series.Secondly, time series analysis seeks to forecast or predict future values of the series by leveraging past data from the same series or potentially other related series.By analyzing the historical patterns and trends, it strives to make informed predictions about future values (Cryer, 1986).

XGBoost
Data scientists frequently utilize the scalable tree boosting approach known as XGBoost (eXtreme Gradient Boosting), which frequently yields cutting-edge findings.A boosting process known as gradient boosting uses a gradient descent method to reduce mistakes.It produces a weak prediction model, like a decision tree, in the form of a model.Incorrect predictions are used to update the models, or weak learners, in boosting and gradient boosting, respectively.Gradient boosting is a method of weight adjustment that takes into account the gradient, which represents the direction of the loss function.Gradient Descent, an iterative optimization technique, is used to optimize the model's loss while continuously updating the weights to achieve this modification.
In the Kaggle competition, XGBoost was used in 17 of the 29 challenge-winning solutions that were published on the Kaggle blog in 2015.Eight of these 17 solutions used XGBoost solely for model training, whereas the majority used it in ensembles with neural networks.On the other hand, 11 solutions made use of deep neural networks, the second most common technique.
The capacity to scale is crucial to XGBoost's success.On a single system, it can operate more than 10 times quicker than other well-known methods, and in a distributed or memory-constrained environment, it can scale to billions of cases.XGBoost's scalability advantage is attained by a variety of significant system and algorithm enhancements.New tree learning algorithms that can handle sparse data are among these breakthroughs, as are theoretically supported weighted quantile sketching techniques that enable fast weight management in learning tree approximation.In order to explore models more quickly, parallel and distributed computing speeds up learning (Chen & Guestrin, 2016).

Random Forest
Random Forest is one of the algorithms in machine learning which is a development of the CART method.It combines the Bootstrap Aggregating (Bagging) method and random feature selection as proposed by Breiman in 2001.Random Forest is a combined tree method in which several trees are built to form a forest, and then analysis is performed on a set of trees.The advantage of using Random Forest is that it can avoid overfitting the data set so as to achieve maximum accuracy.(Bawono & Wasono, 2019).
According to Breiman (2001), a Random Forest is a collection of predictors for trees where each tree relies on the value of a random vector that is sampled separately and with the same distribution for all the trees in the forest (set of trees).Random Forest can be defined as a classifier that contains a collection of structured classifier trees {ℎ(,   ),  = 1, . . .} where {  } is a random vector that is i.i.d. and each tree can vote on the most popular class on input .
Within the Random Forest algorithm is the Bagging or Bootstrap Aggregation method.Bootstrap is a resampling technique used to estimate statistics on populations by trying datasets with replacement (Brownlee, 2019).Each bootstrap result is trained independently and produces an output.The final output is chosen based on the majority result of the bootstrapped models.The step of combining all bootstrap results so that there is a final result is called aggregation (R., Sruthi E., 2023).According to Liaw & Wiener (2002), the Random Forest Algorithm has the following steps: (i) Create ntree number of trees to bootstrap the original data; (ii) Create an unpruned classification or regression tree for each bootstrap sample with a remark that, at each node, the optimal split of all predictors should be chosen after sampling a sufficient number of all predictor variables; and (iii) By combining predictions from ntree trees (the majority class produced from a number of ntree trees), forecast new data.

Forecast Evaluation
In order to assess the quality and effectiveness of models generated using various approaches, evaluation is essential.Model evaluation serves as a means to gauge the performance and reliability of a model during the initial research phase, as well as for ongoing model monitoring (Domino Data Lab, n.d.).In the context of this research, the evaluation utilizes two methods: RMSE (root mean square error) and MAPE (mean absolute percentage error).These metrics provide a quantitative measure of the accuracy and predictive capability of the models, allowing for a comprehensive assessment of their goodness.
RMSE is one of the best overall measurements of model performance because it summarizes the average difference in actual and predicted units.On the other hand, MSE (mean square error) and RMSE are generally amenable to more in-depth mathematical or statistical analysis than MAE (Wilmot, 1982).RMSE measures the total root of the difference between the actual value and the squared prediction.The formal notation of RMSE is: MAPE is an evaluation metric that aims to measure the relative error rate in forecasting.MAPE provides a benchmark for how much error the predicted value produced by a model is when compared to the actual value of the calculation performed (Nabillah & Ranggadara, 2020).MAPE is calculated by taking the absolute difference between the actual value and the forecasted value, then dividing it by the actual value, and finally multiplying by 100 to produce a percentage.Each absolute value of error is measured independently and then measured as a percentage of the actual value, so MAPE gives an idea of the average percentage error in forecasting.The formal notation of MAPE is as follows: (2) The model with RMSE and MAPE values close to zero is the model with the highest level of goodness.This means that the actual and predicted values have a high degree of similarity.

Research Data
This research uses secondary data, including GDP data at current prices, oil and gas-non-oil and gas export and import data, and Indonesian inflation data from the first quarter of 2000 to the first quarter of 2023.The secondary data was obtained from the BPS-Statistics Indonesia and the Ministry of Trade.Random Forest are used as machine learning algorithms. 5. Comparing model evaluation results to find the best method.The evaluation performed is RMSE and MAPE.6. Perform GDP forecasting for the second, third, and fourth quarters of 2023 using the best method.

Forecasting with LSTM
The steps that need to be taken to perform GDP forecasting with LSTM are as follows: 1. Split the data into a training set and a test set, with the training set used to construct and train the model, and the test set used to objectively assess the performance of the model.2. Build a LSTM model with a hard library in Python.Set the number of nodes, steps, and indicators required.3. Evaluate the performance of the model using a test set with relevant evaluation metrics, such as RMSE or MAPE, to evaluate the forecasting error.

Forecasting with SimpleRNN
The steps that need to be taken to perform GDP forecasting with SimpleRNN are as follows: 1. Split the data into a training set and a test set, with the training set used to construct and train the model, and the test set used to objectively assess the performance of the model.2. Build the SimpleRNN model using the Keras deep learning library and set the number of layers, layer size, activation function, and other required hyperparameters.The model is iteratively updated using an optimization algorithm to minimize the prediction error.3. Evaluate the performance of the model using a test set with relevant evaluation metrics, such as RMSE or MAPE, to evaluate the forecasting error.

Forecasting with XGBoost
The steps that need to be taken to perform GDP forecasting with XGBoost are as follows: 1. Split the data into a training set and a test set, with the training set used to construct and train the model, and the test set used to objectively assess the performance of the model.2. Build the XGBoost model using the XGBoost library in Python and determine the appropriate model hyperparameter, such as the number of trees (n_estimators), maximum depth of the tree (max_depth), learning rate, and others.3. Train the XGBoost model using the training set.At each training iteration, the model iteratively improves the predictions by optimizing a predefined objective function.The model is updated by combining the predictions from each tree.4. Evaluate the performance of the model using a test set with relevant evaluation metrics, such as RMSE or MAPE, to evaluate the forecasting error.

Forecasting with Random Forest
The steps that need to be taken to perform GDP forecasting with Random Forest are as follows: 1. Split the data into a training set and a test set, with the training set used to construct and train the model, and the test set used to objectively assess the performance of the model.2. Determining the optimum number of n-decision trees for the data used.The number n can be determined using bootstrapping.3. Form a decision tree according to the number n that has been determined with the training set.
The tree is formed up to the maximum size without any pruning.4. Build and train the model that has been hyperparameter tuning.5. Evaluate the performance of the model using a test set with relevant evaluation metrics, such as RMSE or MAPE, to evaluate the forecasting error.

Result and Analysis
In this section, the results of data analysis are presented.There are two approaches to the variables, one by including additional variables (Inflation, Export, and Import) and the other by excluding additional variables.There are also two forecasting methods approaches, machine learning and deep learning.

Forecasting without Including Other Variables Deep Learning Method
The training data is obtained from the GDP data and lagged GDP for the first, second, and third periods from 2000Q4 to 2020Q4.Meanwhile, the testing data is obtained from the GDP data and lagged GDP for the first, second, and third periods from 2021Q1 to 2023Q1.The forecasting process with deep learning starts with the creation of an RNN network structure.The model consists of one input layer, four hidden layers, and one output layer for the SimpleRNN algorithm.For the LSTM algorithm, the model consists of one input layer, five hidden layers, and one output layer.Next, the model goes through the compilation process with the following hyperparameter:

Machine Learning Method
The training data is obtained from the GDP data and lagged GDP for the first, second, and third periods from 2000Q4 to 2020Q4.Meanwhile, the testing data is obtained from the GDP data and lagged GDP for the first, second, and third periods from 2021Q1 to 2023Q1.
The forecasting process starts by training the model created from the training data using several algorithms, namely XGBoost and Random Forest.Each of these algorithms requires hyperparameter tuning to ensure that the model performs regression effectively.The hyperparameter tuning results for XGBoost used in this forecasting are as follows:

Forecasting with Including Other Variables Deep Learning Method
The training data is obtained from the GDP, Inflation, Export, and Import data from 2000Q1 to 2020Q4.Meanwhile, the testing data is obtained from the GDP, Inflation, Export, and Import data from 2021Q1 to 2023Q1.
The forecasting process with the inclusion of additional variables starts with the creation of an RNN network structure.The process of creating this structure is the same as the forecasting process without including additional variables.The model consists of one input layer, twenty-three hidden layers, and one output layer for the SimpleRNN algorithm.For the LSTM algorithm, the model consists of one input layer, twenty-three hidden layers, and one output layer.Next, the model goes through the compilation process with the following hyperparameters:

Machine Learning Method
Training data is obtained from GDP, Inflation, Export, and Import data from 2000Q1 to 2020Q4.Meanwhile, the testing data is obtained from GDP, Inflation, Export, and Import data from 2021Q1 to 2023Q1.The training and testing processes are the same as the forecasting without including additional variables.The forecasting begins by training the model created from the training data using several algorithms, namely XGBoost and Random Forest.Each of these algorithms requires hyperparameter tuning to ensure that the model performs well.The hyperparameter tuning results for XGBoost used in this forecasting are as follows: After being trained, the model will generate forecasts for the same period as the testing data.The forecasted results and testing data will be compared to evaluate the performance of the model.By comparing the forecasts with the actual values in the testing data, we can assess how well the model has captured the patterns and trends in the data.This evaluation helps us understand the accuracy and reliability of the model's predictions and provides insights into its performance.The results of model forecasting using GDP testing data can be seen in the Table 12 (in billion rupiah):

Conclusion
This research aims to forecast Indonesia's GDP in the second, third, and fourth quarters using the best model from machine learning or deep learning methods.This research uses two approaches, namely by using other variables and without using other variables.Based on the explanation above, the best approach is obtained by using the SimpleRNN algorithm and without including other variables, namely Inflation, Exports, and Imports.With the SimpleRNN algorithm, the GDP value in 2023 for the second, third, and fourth quarters is (in billion rupiah) 5.350.840.00,5.483.895.00, and 5.610.077.50, respectively.

Fig. 5 .
Fig. 5.The results of model forecasting using GDP testing data for forecasting without other variablesThe evaluation results without including additional variables can be seen in the table below.The values are sorted from the lowest to the highest for RMSE and MAPE.

4. 4 .
GDP Forecasting for Q2, Q3, and Q4 Based on research comparing the RMSE and MAPE of each algorithm in two different approaches (including other variables and excluding other variables), it was found that the SimpleRNN algorithm without including additional variables had the smallest RMSE and MAPE.The model created with the SimpleRNN algorithm will be used to forecast the GDP of Indonesia for the second, third, and fourth quarters of 2023.Here are the forecasted GDP values using the SimpleRNN model:

Fig. 7 .
Fig. 7.The result of forecasting Indonesia's GDP for 2023Q2, 2023Q3, and 2023Q4 (LeCun et al., 2015) these transformations, deep learning can learn very complex functions.In classification tasks, the higher representation layers amplify important features of the input to distinguish different classes and reduce irrelevant variations.(LeCunetal., 2015).In simple terms, deep learning learns input data with several layers of modules that perform representations on the data.
Block Output: Finally, it calculates the Block Output that combines the current cell value c(t) with the current Output Gate value.

Table 7 . Metric evaluation of algorithm
Based on these results, for forecasting without including other variables (Inflation, Export, and Import variables), the results show that the SimpleRNN algorithm is the best with the smallest RMSE and MAPE values.

Table 8 . Deep learning hyperparameter for pre-compiled model
After the model is compiled, the next step is to train with the training data.In the training process, the following hyperparameters are selected:

Table 9 . Deep learning hyperparameter for training model
the training process, the model will perform forecasting with the testing data.

Table 10 . Hyperparameter for XGBoost
Meanwhile, the results of hyperparameter tuning for the Random Forest algorithm are as follows:

Table 11 . Hyperparameter for Random Forest
in a decision tree will only be considered if it ensures that each resulting left and right branch contains at least a minimum number of training samples called "min_samples_leaf."This criterion ensures that the leaf nodes, which are the terminal nodes of the tree, have a minimum number of samples for meaningful analysis or decision-making.

Table 12 . The results of model forecasting using GDP testing data for forecasting without other variables
The results of model forecasting using GDP testing data for forecasting with other variablesThe results of the evaluation by including other variables can be seen in the table below.The values are sorted from lowest to highest RMSE and MAPE.

Table 13 . Metric evaluation of algorithm
Based on these results, for forecasting by including other variables (Inflation, Export, and Import variables), the results show that the LSTM algorithm is the best method.