CRUDE PALM OIL PRICE PREDICTION USING MULTILAYER PERCEPTRON AND LONG SHORT-TERM MEMORY

Crude Palm Oil is a leading commodity from Indonesia. Accurate prediction of Crude Palm Oil prices is very important to ensure future prices and help decision making. Study on crude palm oil prices is needed to anticipate fluctuations. In this study, prediction model was made using Multilayer Perceptron and Long Short-Term Memory. The optimization methods in this study are Stochastic Gradient Descent, Root Mean Square Propagation, and Adaptive Moment Estimation. The best model is selected based on Mean Square Error. Based on the results, Long Short-Term Memory model with Adaptive Moment Estimation optimization method is more optimal than Long Short-Term Memory with Stochastic Gradient Descent and Long Short-Term Memory with Root Mean Square Propagation. The prediction results using Long Short-Term Memory with Adam optimization show that the predicted value is not different from the actual value and Mean Absolute Percentage Error is 2.11%. This model has high forecasting accuracy because Mean Absolute Percentage Error is less than 10%.


INTRODUCTION
The Agriculture, Forestry and Fisheries sector became the third largest sector in contributing to Indonesia's Gross Domestic Product (GDP) in 2019, with a contribution of 13.26%. Plantation crops contributed greatly to the sector by 25.7%. One of the plantation commodities is palm oil.
This plant produces two types of palm oil, namely CPO and CPKO. CPO is more widely used when compared to CPKO (Hariyadi, 2014).
Indonesia is the world's largest producer and consumer of palm oil, producing 44 million tonnes of palm oil and consuming 14.27 million tonnes in 2019. Palm oil prices also fluctuate frequently.
The historical price of palm oil from 2010 to October 2020 continues to change significantly. Over the past three years, crude palm oil prices have reached highs and lows. Forecasting of crude palm oil prices is done to predict price fluctuations. Accurate forecasting of Crude Palm Oil prices is very important to ensure future prices and assist decision making. Research on crude palm oil prices is needed to anticipate fluctuations. The uncertainty of crude palm oil prices and the data are non-stationary and non-linear, hence the Artificial Neural Networks (ANN) method is used to forecast crude palm oil prices.
Research by Karia, et al. (2013) concluded that ANN model provides the best results in predicting crude palm oil prices compared to Autoregressive Fractionally Integrated Moving Average (ARFIMA) model and Adaptive Neuro Fuzzy Inference System (ANFIS) model. Based on these results, ANN can be applied to forecasting of crude palm oil prices. ANN has the ability to study non-linear and complex relationships. ANN is useful in time series prediction. One of the ANN methods is Recurrent Neural Networks (RNN), which is designed to recognize patterns as data sequences, can be applied to predictions and forecasts, can also work on text, image, speech, and time series data. RNN has several variants, one of which is Long Short Term Memory (Ciaburro and Venkateswaran, 2017). The design of Long Short-Term Memory can overcome the problem of vanilla RNN, namely vanishing and exploding gradients (Brownlee, 2017). The ANN method as described has advantages over other analytical methods. Therefore, in this study, crude palm oil price predictions were made using ANN. The ANN method applied is Multilayer Perceptron and Long Short-Term Memory.

THEORETICAL FRAMEWORK
Forecasting is the art and science of predicting future events. Past data is used for forecasting and projecting into the future with mathematical models (Heizer and Render, 2011). Forecasting is an objective calculation using past data to determine something in the future (Sumayang, 2003).
Forecasting is classified into two categories, quantitative and qualitative methods. Quantitative methods can be applied if there is information from the past, it can be quantified in the form of numerical data and it can be assumed that some aspects of past patterns will continue in the future.
Qualitative methods do not require data with the same characteristics as quantitative methods. The input required depends on the specific methods, primarily the result of assessment and accumulated knowledge (Makridakis et al., 1997).

Preprocessing Data
Preprocessing data is required by machine learning algorithms to run properly. The machine learning process doesn't work properly when the input numeric attributes are scaled differently.
There are two common ways for attributes to be the same scale, using min-max scaling/normalization and standardization. Min-max scaling runs by shifting the value and rescaling in the range 0 to 1. Min-max scaling is done by subtracting the minimum value and dividing by maximum minus minimum as an equation 1 (Géron, 2017).

Multilayer Perceptron
ANN is a collection of algorithms inspired by the biological brain. ANN consists of simple Multilayer Perceptron consists of one input layer, one or more hidden layers, and one output layer.
Every layer except the output layer includes biased neurons and is fully connected to the next layer.
The training algorithm on the Multilayer Perceptron uses backpropagation (Géron, 2017). The backpropagation training algorithm consists of feedforward to get prediction results and 8037 CRUDE PALM OIL PRICE PREDICTION USING MLP AND LSTM backpropagation of error to get corrected weight and bias values and used to update weights and biases (Fausett, 1994). Multilayer perceptron architecture which consists of one input layer with q neurons, one hidden layer with p neurons and one output layer with one neuron can be written as where , are weights for the unit relationship in the input layer-hidden layer and weights for the unit relationships in the hidden layer-output layer, then where , , are forget gate, input gate, and output gate then ′ , , ℎ are candidate cell state, cell memory state, and output. Cells in the LSTM can be shown in Fig. 1.

Model Performance Measures
One of the important parts of ANN is evaluating its performance. The metric that is often used in regression problems is Mean Square Error (MSE). MSE is defined as the difference of the mean square of the expected value and the predicted result. MSE equation can be written as follows: where is the actual value and ̂ is the predicted value.
The next metric is Mean Absolute Percentage Error (MAPE). MAPE calculates the mean of the absolute percentage error of predictions. The prediction results are better if the MAPE value is getting smaller (Swamidass, 2000).
Model with MAPE value of 10% or less is model with high forecasting accuracy, then model with MAPE value of more than 10% and less than or equal to 20% has a good forecasting rate. MAPE value in the interval of more than 20% and less than or equal to 50% then has a reasonable forecasting rate, and if MAPE is more than 50% then it has an inaccurate forecasting rate (Lewis, 1982).

RESEARCH METHOD
Data in this study is daily price of crude palm oil in Rupiah per kilogram from January 4, 2010 to December 29, 2020 obtained from the Ministry of Trade of the Republic of Indonesia, then converted into supervised and splitted into training data and testing data. There are three ways of splitting the data. The first is 70% training-30% testing, then 75% training-25% testing, and 80% training-20% testing. The data is processed using Google Collaboratory with the methods are Multilayer Perceptron and Long Short-Term Memory. The steps of data analysis are as follows: 1. Load research data.
3. Change the form of the data into a supervised.
4. Split the data into training data and testing data.
5. Normalize the data into a range of 0 to 1. 6. Make model architecture for Multilayer Perceptron and Long Short-Term Memory.
7. Search for the best hyperparameters for each model. 8. Conduct training on each model that has been made using the obtained hyperparameters. 9. Select the best model based on the MSE value in the training data.
10. Make predictions on the testing data using the best model.
12. Measurement of model performance on data testing using MAPE

MAIN RESULTS
Crude palm oil price data is converted into supervised and splitted into training data and testing data. The proportion of training and testing is 70%-30%, 75%-25%, and 80%-20%. Then normalize using min-max scaling, with the scaler derived from the training data. The minimum value is 5764 and the maximum value is 10981. Normalization calculation for the first three data:

Multilayer Perceptron
The first method to predict crude palm oil prices is Multilayer Perceptron (MLP). The input for MLP uses significant lag from the Partial Autocorrelation Function (PACF). PACF of crude palm 8041 CRUDE PALM OIL PRICE PREDICTION USING MLP AND LSTM oil price data can be shown in Fig. 2.  Table 1. considers the number of parameters. Lag 1 and 2, hidden neurons 6, the proportion of training and testing data is 75%-25%, and the optimization method is Adam has weight and bias parameters of 2×6+6×1+6+1=25, less than lag 1 and 2, hidden neurons 8, the proportion of training and testing data is 70%-30%, and the optimization method is RMSProp which has weight and bias parameters of 2×8+8×1+8+1=33, thus lag 1 and 2, hidden neurons 6, the proportion of training and testing data is 75%-25%, and the optimization method is Adam simpler than lag 1 and 2, hidden neurons 8, the proportion of training and testing data is 70%-30%, and the optimization method is RMSProp. Finally the best MLP is lag 1 and 2, hidden neurons 6, the proportion of training and testing data is 75%-25%, and the optimization method is Adam.

Long Short-Term Memory
The Then the best hyperparameters are selected from each optimization method. The best results from each optimization are shown in Table 2.

Model Selection
The best MLP and LSTM results from Table 1 and Table 2 are then shown in Table 3. The smallest MSE value is 32224.17 which is obtained when using LSTM, with time steps 2, hidden neurons 6, the proportion of training and testing data is 70%-30%, and the optimization method is Adam. The best model is model using the LSTM, with time steps is 2, hidden neurons 6, the proportion of training and testing data is 70%-30%, and the optimization method is Adam. The model is used to predict crude palm oil prices. Predictions were made on testing data, from March 15, 2017 to December 29, 2020. The actual data and the predicted data are shown in Fig. 3. Fig. 3 shows plot of the actual data and the predicted data of crude palm oil prices. The green plots are actual data, while the blue plots are predictive data. Based on Fig. 3, it can be seen that the model can produce the appropriate output, because the prediction results are similar to the actual data. Model performance is measured using MAPE. Based on the prediction results, MAPE value is 2.11%. Model has high forecasting accuracy because MAPE is less than 10%.

CONCLUSION
According to the results and discussion, it can be concluded that the best time series model for predicting AALI returns for the period of 3 October 2012 to 1 October 2019 is ARIMA(0,0,1)-GARCH (Based on the results, it can be concluded that the best model is using the LSTM method, time steps 2, hidden neurons 6, and the optimization method is Adam. The prediction results are not different from the actual value, with MAPE value is less than 10% so that it has high forecasting accuracy.