**Comparison of Fuzzy Time Series And Arima Model for Predicting Stock Prices**

\*\*This is a Double-blind review, please do not include authors information in this version \*\*

Received Date: \*date

Accepted Date: \*date

Published Date: \*date

**HIGHLIGHTS**

  - The stock market is volatile and unpredictable for investor, thus having an accurate forecasting of future market environment is essential to minimize losses.

  - Two forecasting models are developed using fuzzy time series (FTS) and autoregressive integrated moving average (ARIMA) algorithm to predict the value of share price in the future.

  - With the lowest MAPE, MSE, and RMSE values, ARIMA model outperforms FTS model.

ABSTRACT

*The stock market has always been a contentious topic in society, and it is a place where economic standards are established. The stock market is incredibly unpredictable and turbulent. This means that the shares may fluctuate for reasons that are sometimes difficult to understand. Due to this uncertainty, many investors believe the stock market as a risky investment. Therefore, having an accurate picture of future market environment is crucial to minimising losses. Forecasting is a technique of predicting the future based on the outcome of the previous data. There are a wide range of forecasting algorithms, however, this study only focuses on these two techniques: Auto Regressive Moving Average (ARIMA) model and Fuzzy Time Series (FTS) Model. The goal of this study is to evaluate and compare the effectiveness of the ARIMA model and the FTS model in predicting sample data of stock prices of Top Glove Corporation Berhad since this company is the largest glove supplier in the world and plays a significant role in the Covid-19 global pandemic crisis. The error measures that were taken into consideration consist of Root Mean Square Error (RMSE), Mean Square Error (MSE), and Mean Absolute Percentage Error (MAPE). These measurements were computed numerically and graphically using a statistical programme called EViews. The outcome shows that the ARIMA model performs better than the FTS model in terms of forecasting accuracy and provides the lowest values of MAPE, MSE, and RMSE, which are 10.58757, 0.926354, and 0.962473, respectively.*

*Keywords: Autoregressive Integrated Moving Average (ARIMA), Fuzzy Time Series (FTS), Stock Price, Share Price, Forecasting,*

# INTRODUCTION

The term stock price refers to the current price that a share of stock is trading for on the market. When shares of a publicly traded firm are issued, their value is assigned at a price that, ideally, represents the worth of the company itself. The intrinsic value of the stock could increase or decrease. Finding equities that are currently undervalued is the aim of most stock investors.

The stock market is very volatile and extremely unpredictable. This means that the shares can come down or go up for reasons that sometimes cannot be explained, though other times they can be. Due to this unpredictability, the stock market is considered a risky prospect for many investors. There are many factors can affect the stock prices such as supply and demand, interest rates, exchange rates fluctuations, political upheaval, natural calamities and much more (Csiszar, 2020). All these factors can affect the yields of investors. However, if the market is studied in detail and investors have a clear understanding of the market, they can decide the best time to buy or sell stock and earning good return. The best prediction of timing the stock is the key to successful investing. Various types of models have been introduced by researchers to anticipate stock prices such as the Autoregressive Integrated Moving Average (ARIMA), Residual Income Model (RIM), Integrated Artificial Neural Network (ANN), Long Short-Term Memory (LTSM), and Fuzzy Time Series (FTS). Each of these mathematical models has their own set of benefits and drawbacks. This study aims to make a comparison between the performance of the ARIMA model and the FTS model in predicting stock prices of Top Glove Corporation Bhd. The advantages and disadvantages of these models are discussed.

**Previous Research on ARIMA model and FTS model**

Time series analysis is a specific way of analyzing a sequence of data points collected over an interval of time. Data points are recorded at consistent intervals over a set period of time. Time series analysis is important in various fields such as economics, social science, epidemiology, medicine and many more. It can be used for forecasting, which is predicting future data or likelihood of future events based on historical data.

In a study conducted by Alzahrani, Aljamaan, and Al-Fakih (2020), four time-series models are applied, namely Autoregressive (AR), Moving Average (MA), Autoregressive Moving Average (ARMA), and ARIMA models to find the best fit model. The main purpose of the study is to observe and forecast the spread of Covid-19 in Saudi Arabia by using historical data of daily cases. The study concluded that the most suitable model to be applied for prediction purposes is ARIMA. It is proved by evaluating the root mean square error (RMSE), root mean squared relative error (RMSRE), mean absolute percentage error (MAPE), mean absolute error (MAE), and coefficient of determination (R<sup>2</sup>). The ARIMA model was also utilised by Sahai, Rath, Sood, and Singh (2020) to forecast Covid-19 cases in five nations: Brazil, Russia, the United States, Spain, and India. The results showed that ARIMA models portrayed a good accuracy for Covid-19 cases in those five countries and gave benefits to the governments of these countries to prepare better strategies in managing the pandemic during critical period.

According to Phan and Nguyen (2020), time series models like Autoregressive Integrated Moving Average (ARIMA) is most efficient when modeling linear time series forecasting but less efficient for non-linear models. Therefore, a combination of two methods, namely ARIMA and machine learning (ML), to build a water level forecasting model has been proposed by authors. The results proved that a hybrid model provides a better accuracy compared to forecasting using a single model. In conclusion, hybridizing a linear and a non-linear time series model produces robust forecasting results.

Specifically for predicting stock prices, Kumar Meher et al. (2021) used the ARIMA Model to anticipate the share prices of pharmaceutical companies in India. The findings of their study revealed that different share price businesses have varying levels of trustworthiness. For example, Sun Pharmaceutical's prediction between the actual and anticipated share prices appears to be more dependable than Dr Reddy Laboratories. Furthermore, they also discovered that the ARIMA model might be more trustworthy with a higher value of R and modified R-squared if it is constructed with fewer periods.

Another approach for time series analysis is Fuzzy Time Series (FTS). According to Zadeh (1965) who was the first introduced the fuzzy set theory, this theory offers a wide range of scientific applications. A fuzzy time series (FTS) approach based on fuzzy set theory was introduced as an alternative to the traditional time series models. Zhang et al. (2010) stated in their study that people could solve forecasting difficulties using Fuzzy Time Series that combines people's subjective attitudes and objective history values. Their study incorporates Fuzzy Time Series into crude oil price predictions for the short term. They looked at West Texas Intermediate oil and utilized the root mean square error method to assess the performance of their method and their findings show that Fuzzy time series can produce good forecast results.

Lee & Suhartono (2012) proposed a new weighted fuzzy time series model to increase forecast accuracy in seasonal data, based on the Exponential Smoothing approach and graphical order selection in their work. Their research demonstrates how the graphical order fuzzy relationship may be used to quickly determine the best order for fuzzy time series. Jilani & Burney (2008) studied a basic time-variant fuzzy time series forecasting algorithm. The suggested method employs a heuristic approach to define frequency-density-based partitions of the universe of discourse. They developed a fuzzy metric to apply frequency-density-based partitioning. The forecast is calculated using a trend predictor in the proposed fuzzy metric. They stated that this new technology is being used to forecast the enrolments of University of Alabama. The result demonstrated that the suggested method is more accurate than other fuzzy time series methods.

FTS models have been used to forecast stock market prices because it can extract pertinent information from big data sets without relying on any model assumptions. It also can be used to predict individual stock prices, establish the trend of the stock market based on the anticipated open, high, low, and close values, and help traders decide whether to buy or sell a stock. (Hwang & Oh, 2010). Referring to all research findings from earlier studies, this study is created with the goal of contrasting ARIMA and FTS in order to evaluate the trend movement of Top Glove Corporation Berhad, the largest glove supplier in the world and a key player in the Covid-19 global pandemic catastrophe.

# METHODOLOGY 

This study will analyze the share prices of Top Glove Corporation Bhd from January 2017 to August 2021 by using ARIMA and FTS. Top Glove Corporation Bhd is a healthcare company that manufactures and sells medical equipment and supplies. This company makes, research, trades gloves and rubber items, and also provides E-commerce services for healthcare supplies and glove trade. The data was gathered from Bursa Market Place, a website providing real-time stock quotes and market news in Malaysia.

**Autoregressive Integrated Moving Average (ARIMA)**

ARIMA is a forecasting algorithm that is most widely used in time series analysis. The development process of an ARIMA model is divided into three stages: Model Identification, Model Estimation, and model validation (Lazim, 2005). ARIMA has three inputs which are p, d, and q, and is written in general form as ARIMA(p,d,q). p represents the number of lag observations; d is the degree of difference; q represents the size of the moving average. The differencing process is required to make the data stationary if it is not already stationary. This process will remove the trend pattern from the actual data. The number of times the data must differ before they become stationary is indicated by the order of differencing. The mathematical formula as follows:

\[\mathrm{\Delta}\left( \mathrm{\Delta}y_{t} \right) = \ \mathrm{\Delta}y_{t} - \mathrm{\Delta}y_{t - 1},\]

> \= (\(y_{t} - \ y_{t - 1}) - (y_{t - 1} - y_{t - 2}),\)
> 
> \= \(y_{t}\) - \({2y}_{t - 1}\)+ \(y_{t - 2},\) (1)

where \(\mathrm{\Delta}y_{t}\ \)is the number of differences. Backward shift operator is a useful notation used when differentiating. The following formula uses operator B to represent the number of backward steps.

First-order differencing:

> \(\mathrm{\Delta}y_{t} = \ y_{t} - \ y_{t - 1},\)

\(= \left( 1 - B \right)y_{t}.\)

Second-order differencing:

\[\mathrm{\Delta}\left( \mathrm{\Delta}y_{t} \right) = \ \mathrm{\Delta}y_{t} - \mathrm{\Delta}y_{t - 1},\]

> \= (\(y_{t} - \ y_{t - 1}) - (y_{t - 1} - y_{t - 2})\),
> 
> \= \(y_{t}\) - \({2y}_{t - 1}\)+ \(y_{t - 2}\),
> 
> \= (1- 2\(B\) *+*\(B^{2}\)*)* \(y_{t}\) or \({(1 - B)}^{2}y_{t}\). (2)

The Autoregressive (AR) model

> \(y_{t} = \ \mu + \varnothing_{1}y_{t - 1} + \varnothing_{2}y_{t - 2} + \ldots + \varnothing_{p}y_{t - p} + \varepsilon_{t},\) (3)

where \(\mu\) and \(\varnothing\) are constant parameters, \(y_{t} =\) current value, \(y_{t - p} = p^{\text{th}}\) is the order of lagged current value, \(\varepsilon_{t} =\) error term.

By backward shift operator:

> \({(1 - \varnothing}_{1}B - \varnothing_{2}B^{2} - \ldots - \varnothing_{p}B^{p})y_{t} = \mu + \varepsilon_{t}.\) (4)

The Moving Average (MA) model

> \(y_{t} = \ \mu - \theta_{1}\varepsilon_{t - 1} - \theta_{2}\varepsilon_{t - 2} - \ldots - \theta_{p}\varepsilon_{t - p} + \varepsilon_{t},\) (5)

where\(\ \mu = \ \)mean, \(\theta\) is the moving average, \(\varepsilon_{t} =\) error term.

By backward shift operator:

> \(y_{t} = \mu + \left( 1 - \theta_{1}B - \theta_{2}B^{2} - \ldots - \theta_{q}B^{q} \right)\varepsilon_{t}.\) (6)

The general algorithm of ARIMA (*p, d, q*), where *d* is the number of times the \(y_{t}\) needs to be different to achieve stationary.

> \(w_{t} = \mu + \varnothing_{1}w_{t - 1} - \theta_{1}\varepsilon_{t - 1} + \varepsilon_{t}\),

where\(\ w_{t} = \ y_{t} - \ y_{t - 1},\) the first difference or can be written as

> \({(1 - \varnothing}_{1}B)w_{t} = \ \mu + \left( 1 - \theta_{1}B \right)\varepsilon_{t}.\) (7)

***Model Identification***

The dataset is first split into estimation and evaluation parts. Afterward, the line charts of the autocorrelation function (ACF), and the partial autocorrelation function (PACF) are plotted to observe the stationary behaviour and identify at least five versions of the ARIMA general model that are most appropriate.

|     | **ACF** | **PACF** | **Model type**                                                        |
| --- | ------- | -------- | --------------------------------------------------------------------- |
| 1\. | Decay   | Spikes   | *AR(p) ; p* is the number of spikes in the PACF.                      |
| 2\. | Spikes  | Decay    | *MA(q); q* is the number of spikes in the ACF.                        |
| 3\. | Spikes  | Spikes   | *ARMA(p, q); p* and *q* are the number of spikes in the PACF and ACF. |

> **TaTTable 1:** Identifying the ARIMA model

***Model Estimation***

By comparing the results of AIC, BIC, Hannan-Quinn and Durbin-Watson, adjusted R squared, MSE, and White Noise, the most suited model of ARIMA(*p,d,q*) can be selected. Then the model with optimal performance is chosen based on the error measurements, namely the Mean Absolute Percent Error (MAPE), Root Mean Square Error (RMSE), and Mean Square Error, choose the optimal model (MSE). The following specific criteria were taken into account: i) Relatively small of BIC (Bayesian or Schwarz Information Criterion), ii) Relatively small standard error of the regression (SE of regression), iii) Relatively high of adjusted R<sup>2</sup> and iv) Q-statistics and correlogram with no significant pattern in the autocorrelation functions (ACFs) and partial autocorrelation functions (PACFs) of the residuals, which means the residual of the selected model is white noise.

**Fuzzy Time Series (FTS) Using Cheng’s Model Algorithm**

**Step 1:** Define the discourse universe and rule abstraction intervals. The discourse universe can be characterized as follows:\(\ U:\) \[minimum value, maximum value\]. If the occurrence of linguistic intervals is greater than the average occurrence of all linguistic intervals, these intervals must be separated to achieve high forecasting accuracy. Sturges formula can be used to calculate the number of linguistic intervals *w*:

\(w = 1 + 3.322\log{10\ (n)}\) (8)

While the formula below can be used to calculate the length of linguistic intervals,

\(\frac{Maximum\ value - Minimum\ value}{n}\) (9)

where *n* is the total number of observations.

**Step 2:** Create an associated fuzzy set (linguistic value) for each observation in the training dataset. The fuzzy sets \(A_{1}\), \(A_{2}\),..., \(A_{k}\) for the universe of discourse are defined in this stage by the Sturges formula, where the value of \(a_{\text{ij}}\) denotes the grade of membership of \(u_{\text{ij}}\) in fuzzy set \(A_{i}\), where \(a_{\text{ij}} \in \left\lbrack 0,1 \right\rbrack\ ,\ 1 \leq i \leq k\) and \(1 \leq j \leq m.\) This process will determine the degree to which each stock price belongs to each \(A_{i}\left( i = 1,\ldots,m \right).\) If the stock price's maximum membership is less than the fuzzified stock price \(A_{k}\), then it is labelled as follows.( Chen, 1996)

\[A_{1} = \frac{a_{11}}{u_{1}} + \frac{a_{12}}{u_{2}} + \ldots + \frac{a_{1m}}{u_{m}},\]

\[A_{2} = \frac{a_{21}}{u_{1}} + \frac{a_{22}}{u_{2}} + \ldots + \frac{a_{2m}}{u_{m}},\]

…

\(A_{k} = \frac{a_{k1}}{u_{1}} + \frac{a_{k2}}{u_{2}} + \ldots + \frac{a_{\text{km}}}{u_{m}}.\) (10)

**Step 3:** Establish fuzzy relationships and fuzzification. Two consecutive fuzzy sets, \(A_{i}(t - 1)\) and \(A_{j}\left( t \right)\ \)can be combined into a single FLR as \(A_{i} \rightarrow A_{j}\).

**Step 4:** Create an FLRG for each FLR. FLRG can be formed by grouping FLR with the same LHSs. \(A_{i} \rightarrow A_{j}\), \(A_{i} \rightarrow A_{k}\), \(A_{i} \rightarrow A_{m}\), can be grouped as \(A_{i} \rightarrow A_{j}\), \(A_{k}\), \(A_{m}\). A fluctuation-type matrix will be constructed by all FLRs.

**Step 5:** Assign a weight to each item. The fluctuation-type matrix from step 4 is further standardized to \(W_{n}(t)\). The standardized weight matrix equation should be used to normalize the weight matrix:

\(W_{n}\left( t \right) = \left\lbrack {W^{'}}_{1},{W^{'}}_{2},\ldots,{W^{'}}_{j} \right\rbrack = \left\lbrack \frac{W_{1}}{\sum_{k = 1}^{i}W_{k}},\frac{W_{2}}{\sum_{k = 1}^{i}W_{k}},\ldots,\frac{W_{k}}{\sum_{k = 1}^{i}W_{k}} \right\rbrack\) (11)

**Step 6:** Multiply the weight matrix,\(\ W_{n}\left( t - 1 \right)\), by the defuzzified matrix, \(L_{\text{df}}\left( t - 1 \right)\) to get the initial forecast value. The median of each linguistic interval is the entry of the defuzzified matrix, therefore \(L_{\text{df}} = \left\lbrack m_{1,}m_{2},\ldots,m_{k} \right\rbrack\) is defined, where \(m_{k}\) is the median of each linguistic interval. This equation below can be used to calculate the initialization forecast:

\(F_{t} = L_{\text{df}}\left( t - 1 \right).W_{n}\left( t - 1 \right)\ \) (12)

**Step 7:** Calculate the value of the adaptive forecast specified in this equation:

> \(\text{adaptive\ forecast}\left( t \right) = p\left( t - 1 \right) + h^{*}\left\lbrack F\left( t \right) - p\left( t - 1 \right) \right\rbrack,\) (13)

with \(p\left( t - 1 \right)\) ; the current stock index at time t-1, F(t) is the initial forecasting value from the equation in step 6, and adaptive forecast (t) is the convincing forecasting value for the future stock price (t).

**FINDINGS AND DISCUSSIONS**

**Data Analysis with ARIMA Model**

Visual inspection of the time series plots reveals some patterns such as trends, seasonal variations, and cyclical changes. Therefore, a transformation is required to make the time series data stationary. After the first differencing, the time series data appears to be stationary at first glance. Then, a formal technique known as the Augmented Dickey-Fuller (ADF) test is used to verify the stationarity of the time series data.

**Table 2:** Augmented Dickey-Fuller Test for the share price of Top Glove Corporation

![Table Description automatically generated with medium confidence](6319425d4b2ed_media/media/image1.tmp)

Table 2 shows the outcomes of this test, which was conducted using EViews. A 5% level of significance was used to test this hypothesis. The probability of the ADF test statistic is 0.0017, which is less than the critical value of 0.05 for the first-order difference. This indicates that the data become stationary after first differencing.

Figure 1 shows the Autocorrelation Function (ACF) and the Partial Autocorrelation Function (PACF) of the data after performing the first differencing. There is one spike in the ACF at lag 1, and the value changes faster at lag 2, which degrades to almost zero quickly at lag 3. For PACF, there is one spike at lag 1, and also have a decaying pattern as ACF. A series is said to be stationary if it does not show growth or decline over time which the data series does not indicate any trend component (Lazim, 2005). Therefore, the data is now stationary. In Figure 1, there is one spike in the ACF at lag 1, and there is one spike in the PACF. These features suggest ARIMA (1,1,1) as an initial model. As this model might not be the best fit, other possible models are identified by considering every possible combination of ‘p’ and ‘q’ which is closest to ARIMA (1,1,1). As a result, the following three models have been chosen and identified; ARIMA(0,1,0), ARIMA (0,1,1) and ARIMA (1,1,0). EVIEWS are used again to calculate the non-seasonal AR and MA parameter estimates and the results are shown in Table 3.

![](6319425d4b2ed_media/media/image2.tmp)

**Figure 1**: ACF and PACF of Share Price Data

**Table 3**: ARIMA models comparison

|                                | ARIMA(1,1,1) | ARIMA(0,1,0) | ARIMA(0,1,1) | ARIMA(1,1,0) |
| ------------------------------ | ------------ | ------------ | ------------ | ------------ |
| AIC                            | 2.930649     | 2.954272     | 2.914298     | 2.891614     |
| BIC                            | 3.097827     | 2.996067     | 3.039681     | 3.016997     |
| Hannan – Quinn                 | 2.991526     | 2.96941      | 2.959955     | 2.937271     |
| Durbin Watson                  | 1.943608     | 1.124702     | 1.869034     | 2.002893     |
| R squared (adjusted R squared) | 0.097460     | 0.000000     | 0.085436     | 0.107317     |
| S.E. of regression             | 0.994896     | 1.047235     | 1.001501     | 0.989448     |
| White Noise                    | Yes          | Yes          | Yes          | Yes          |

Based on result in Table 3, the residuals of all models are white noise, meaning that there are no significant autocorrelation coefficients, and no partial autocorrelation coefficients exist (Lazim, 2005). The ARIMA (1,1,0) is considered a better fit among all other models because it has the lowest value of AIC, BIC, Hannan-Quinn, and SE of regression. In addition, the value of its R-squared is also highest among all the suggested models. Thus ARIMA (1,1,0) is selected to be used in predicting the share price of Top Glove as shown in Figure 2.

![](6319425d4b2ed_media/media/image3.tmp)

**Figure 2**: The graph of actual and forecasted data

The mean squared error (MSE), mean absolute percentage error (MAPE), and root mean squared error (RMSE) values provided by the ARIMA model are 0.926354, 10.58757 and 0.962473, respectively.

**Data Analysis with FTS Model**

The value of discourse universe or rule abstraction intervals for the data are as follows:

\(U:\) \[minimum value, maximum value\]

U: \[2.31; 24.85\]

Example calculation of sub-interval for \(U_{1}\): 2.51125 – 2.31 = 0.20125

Example calculation of median for \(U_{1}:\ \frac{2.31 + 2.51125}{2} = 2.410625\) . Overall values for sub-interval and median are shown in Table 4.

**Table 4:** Linguistic Interval Partition

<table>
<thead>
<tr class="header">
<th>Linguistic Interval</th>
<th>Occurrence</th>
<th>Condition</th>
<th>Sub interval</th>
<th>Median</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><br /><span class="math display"><em>U</em><sub>1</sub> = [2.31; 2.51125]</span><br /></td>
<td>5</td>
<td>Fifth</td>
<td>0.20125</td>
<td>2.410625</td>
</tr>
<tr class="even">
<td><br /><span class="math display"><em>U</em><sub>2</sub> = [2.51125; 2.7125]</span><br /></td>
<td>4</td>
<td>Fifth</td>
<td>0.20125</td>
<td>2.611875</td>
</tr>
<tr class="odd">
<td><br /><span class="math display"><em>U</em><sub>3</sub> = [2.7125; 2.91375]</span><br /></td>
<td>1</td>
<td>Fifth</td>
<td>0.20125</td>
<td>2.813125</td>
</tr>
<tr class="even">
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
</tr>
<tr class="odd">
<td><br /><span class="math display"><em>U</em><sub>20</sub> = [15.19; 18.41]</span><br /></td>
<td>0</td>
<td>First</td>
<td>3.22</td>
<td>16.8</td>
</tr>
<tr class="even">
<td><br /><span class="math display"><em>U</em><sub>21</sub> = [18.41; 21.63]</span><br /></td>
<td>0</td>
<td>First</td>
<td>3.22</td>
<td>20.02</td>
</tr>
<tr class="odd">
<td><br /><span class="math display"><em>U</em><sub>22</sub> = [21.63; 24.85]</span><br /></td>
<td>2</td>
<td>First</td>
<td>3.22</td>
<td>23.24</td>
</tr>
</tbody>
</table>

The number of intervals formed can be used to determine linguistic values during the fuzzification stage depending on the effective interval obtained. Table 5 shows the result of the fuzzification using Cheng Model notated in linguistic numbers.

**Table 5:** Fuzzification and FLR

<table>
<thead>
<tr class="header">
<th>Month</th>
<th>Date</th>
<th>Share price</th>
<th>Fuzzification</th>
<th>Fuzzy Logic Reasoning(FLR)</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1</td>
<td>1/1/2017</td>
<td>2.44</td>
<td>A1</td>
<td>-</td>
</tr>
<tr class="even">
<td>2</td>
<td>1/2/2017</td>
<td>2.36</td>
<td>A1</td>
<td><br /><span class="math display"><em>A</em>1 → <em>A</em>1</span><br /></td>
</tr>
<tr class="odd">
<td>3</td>
<td>1/3/2017</td>
<td>2.36</td>
<td>A1</td>
<td><br /><span class="math display"><em>A</em>1 → <em>A</em>1</span><br /></td>
</tr>
<tr class="even">
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
</tr>
<tr class="odd">
<td>54</td>
<td>1/6/2021</td>
<td>4.68</td>
<td>A12</td>
<td><br /><span class="math display"><em>A</em>13 → <em>A</em>12</span><br /></td>
</tr>
<tr class="even">
<td>55</td>
<td>1/7/2021</td>
<td>3.98</td>
<td>A9</td>
<td><br /><span class="math display"><em>A</em>12 → <em>A</em>9</span><br /></td>
</tr>
<tr class="odd">
<td>56</td>
<td>1/8/2021</td>
<td>3.81</td>
<td>A8</td>
<td><br /><span class="math display"><em>A</em>9 → <em>A</em>8</span><br /></td>
</tr>
</tbody>
</table>

Next, Fuzzy Logical Relationship Group (FLRG) is performed by grouping fuzzy sets with the same current state into one group in the next state, as shown in Table 6.

**Table 6:** Fuzzy Logical Relationship Group (FLRG)

<table>
<thead>
<tr class="header">
<th>Fuzzification</th>
<th>FLRG</th>
<th>Number of relations</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>A1</td>
<td>A1, A2</td>
<td>2</td>
</tr>
<tr class="even">
<td>A2</td>
<td>A2, A3</td>
<td>2</td>
</tr>
<tr class="odd">
<td>A3</td>
<td>A5</td>
<td>1</td>
</tr>
<tr class="even">
<td><p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p></td>
</tr>
<tr class="odd">
<td>A14</td>
<td>A10, A13, A14, A15</td>
<td>4</td>
</tr>
<tr class="even">
<td>A15</td>
<td>A12, A14, A15, A16, A17</td>
<td>5</td>
</tr>
<tr class="odd">
<td>A16</td>
<td>A15,A19</td>
<td>2</td>
</tr>
<tr class="even">
<td>A17</td>
<td>A13, A16, A17</td>
<td>3</td>
</tr>
<tr class="odd">
<td>A18</td>
<td>-</td>
<td>0</td>
</tr>
<tr class="even">
<td>A19</td>
<td>A19, A22</td>
<td>2</td>
</tr>
<tr class="odd">
<td>A20</td>
<td>-</td>
<td>0</td>
</tr>
<tr class="even">
<td>A21</td>
<td>-</td>
<td>0</td>
</tr>
<tr class="odd">
<td>A22</td>
<td>A17, A22</td>
<td>2</td>
</tr>
</tbody>
</table>

There are two stages involved in the fuzzy time series forecasting process. The first stage is finding the middle value for each period, and the second stage is calculating the predicted values. Table 7 shows the defuzzification result obtained using FLRG. The calculation of the initial forecast value (Yt) is as follows:

\[\text{Initial\ forecast\ }\left( \text{Yt} \right) = total\ of\ all\ weight\ matrix\  \times median\]

For example, for \(Y_{2} = \ \frac{4}{5} \times 2.410625 + \frac{1}{5}\  \times 2.611875 = 2.450875,\)

where the weight matrix of \(W_{1,1}\) is \(\frac{4}{5}\) and \(W_{1,2}\) is \(\frac{1}{5}\). The \(2.410625\) and \(2.450875\ \)are the values of the median for A1 and A2.

\[Adaptive\ forecast = share\ price\ of\ month\ before + (adaptive\ value(0.2)*(initial\ forecast\ current\ month - share\ price\ of\ month\ before))\]

**Table 7:** Defuzzification of Forecasting Share Price

<table>
<thead>
<tr class="header">
<th>Date</th>
<th><p>Share Price</p>
<p>(Xt)</p></th>
<th>Fuzzification</th>
<th>Initial Forecast(Yt)</th>
<th>Adaptive Forecast</th>
<th>(Xt-Yt)^2</th>
<th><p>Abs</p>
<p>(Xt-Yt)/Xt*100</p></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1/1/2017</td>
<td>2.44</td>
<td>A1</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>1/2/2017</td>
<td>2.36</td>
<td>A1</td>
<td>2.450875</td>
<td>2.442175</td>
<td>0.006753</td>
<td>3.481991525</td>
</tr>
<tr class="odd">
<td>1/3/2017</td>
<td>2.36</td>
<td>A1</td>
<td>2.450875</td>
<td>2.378175</td>
<td>0.00033</td>
<td>0.770127119</td>
</tr>
<tr class="even">
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td><p>.</p>
<p>.</p>
<p>.</p></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>1/6/2021</td>
<td>4.68</td>
<td>A12</td>
<td>4.792083333</td>
<td>4.782417</td>
<td>0.010489</td>
<td>2.188390312</td>
</tr>
<tr class="even">
<td>1/7/2021</td>
<td>3.98</td>
<td>A9</td>
<td>4.909479167</td>
<td>4.725896</td>
<td>0.556361</td>
<td>18.74110134</td>
</tr>
<tr class="odd">
<td>1/8/2021</td>
<td>3.81</td>
<td>A8</td>
<td>3.819375</td>
<td>3.947875</td>
<td>0.01901</td>
<td>3.618766404</td>
</tr>
<tr class="even">
<td>Error</td>
<td>MSE</td>
<td>6.441943</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td></td>
<td>RMSE</td>
<td>2.538098</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td></td>
<td>MAPE</td>
<td>13.87547816</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>

The actual data is compared with the forecasted share price, as shown in Figure 3. This Cheng method has a weighting value known as an additive value, and its range varies from 0 to 1. This study uses an adaptive value of 0.2 because it provides the best predictions.

<span class="chart">\[CHART\]</span>

**Figure 3:** Comparison plot of actual data and forecasted share price

As a result, the mean absolute percentage error (MAPE), mean square error (MSE), and root mean square error (RMSE) values are 13.87547816, 6.441943, and 2.538098, respectively. The comparison of error measures for predicting share price using the ARIMA model and Fuzzy Time Series is shown in Table 8. The values of error measures of the ARIMA model are less than the FTS model for all three measurements. Consequently, in order to anticipate the share price of Top Glove Corporation, the ARIMA model performs better than the Fuzzy Time Series model.

**Table 8:** The Comparison MAPE, MSE, and RMSE on Forecasting Methods to Predict Share Price

| Method            | MAPE        | MSE      | RMSE     |
| ----------------- | ----------- | -------- | -------- |
| ARIMA Model       | 10.58757    | 0.926354 | 0.962473 |
| Fuzzy Time Series | 13.87547816 | 6.441943 | 2.538098 |

**CONCLUSION AND RECOMMENDATIONS**

Based on the discussion and results of the above comparative analysis of the Autoregressive Integrated Moving Average (ARIMA) model and the Fuzzy Time Series (FTS) model in forecasting the stock price of Top Glove Corporation, it can be concluded that the ARIMA model outperforms the FTS model in terms of forecasting accuracy and produces smaller mean absolute percentage error (MAPE), mean squared error (MSE), and root mean squared error (RMSE) values.

There are a variety of approaches for comparing and determining which method is the best for forecasting. To get more precise findings, various algorithms may be used to train the projected value. Therefore, future researchers can utilise and evaluate any sample data by using various forecasting techniques such as the Residual Income Model (RIM), Integrated Artificial Neural Network (ANN), Long Short-Term Memory (LTSM), and many more to get a comprehensive overview of all methods in terms of accuracy and able to choose the most effective forecasting approach.

**REFERENCES**

Alzahrani, S. I., Aljamaan, I. A., Al-Fakih, E. A. (2020). Forecasting the spread of the COVID-19 pandemic in Saudi Arabia using ARIMA prediction model under current public health interventions. *Journal of Infection and Public Health*, 13(7), 914 -919.

Csiszar, J. (2020, November 2). *What Makes Stock Prices Go Up or Down? Here Are the Reasons*. <https://www.gobankingrates.com/investing/stocks/what-makes-a-stock-go-up/amp/>

Devi, M., Kumar, J., Malik, D., & Mishra, P. (2021). Forecasting of wheat production in Haryana using hybrid time series model. *Journal of Agriculture and Food Research*, *5*, 100175.

Hwang, H., & Oh, J. (2010). Fuzzy models for predicting time series stock price index. *International Journal of Control, Automation and Systems*, 8(3), 702–706.

Jilani, T. A., & Burney, S. M. A. (2008). A refined fuzzy time series model for stock market forecasting. *Physica A: Statistical Mechanics and Its Applications*, 387(12), 2857–2862.

Kumar Meher, B., Thonse Hawaldar, I., Spulbar, C., & Birau, R. (2021). Forecasting stock market prices using mixed ARIMA model: a case study of Indian pharmaceutical companies. *Investment Management and Financial Innovations*, 18(1), 42–54.

Lazim, M. A. (2005). *Introductory Business Forecasting* (3rd ed.). Amsterdam University Press.

Lee, M. H., & Suhartono. (2012). A weighted fuzzy time series model for forecasting seasonal data. *Journal of Quality Measurement and Analysis (JQMA)*, 8(1), 85–95.

Phan, T.T.H., Nguyen, X. H. (2020). Combining statistical machine learning models with ARIMA for water level forecasting: The case of the Red river. *Journal of Advances in Water Resources*, 142(103656).

[Sahai](https://pubmed.ncbi.nlm.nih.gov/?term=Sahai+AK&cauthor_id=32755845), A. K., [Rath](https://pubmed.ncbi.nlm.nih.gov/?term=Rath+N&cauthor_id=32755845), N., [Sood](https://pubmed.ncbi.nlm.nih.gov/?term=Sood+V&cauthor_id=32755845), V., [Singh](https://pubmed.ncbi.nlm.nih.gov/?term=Singh+MP&cauthor_id=32755845), M. P. (2020). ARIMA modelling & forecasting of COVID-19 in top five affected countries. *Diabetes Metab Syndr*, 14(5), 1419-1427

Zadeh, L. A. (1965). Fuzzy sets. *Journal of Information and Control,* 8(3), 338 – 353.

Zhang, X., Wu, Q., & Zhang, J. (2010). Crude oil price forecasting using fuzzy time series. *2010 3rd International Symposium on Knowledge Acquisition and Modeling, KAM 2010*, 213–216.
