Implementing lee's model to apply fuzzy time series in forecasting bitcoin price

ABSTRACT


INTRODUCTION
The COVID-19 viral epidemic at the end of 2019 forced all human activities-including labor, business, study, and other pursuits-to transition to digital services, prompting the World Health Organization to declare a pandemic.It causes the development of technology to accelerate in various fields, including the financial sector.According to research conducted by McKinsey, during the pandemic in general, the use of digital technology in the financial industry continues to increase, where 73% of people have tried using digital technology, with the other 21% being new users [1].So, the world community is increasingly using cryptocurrency for digital payments and investments.
The Bank of Canada defines cryptocurrency as decentralized digital money that uses encryption to ensure security [2].Since no central body is issuing cryptocurrencies, they are considered decentralized and potentially impervious to manipulation or intervention by the government [3].Cryptocurrency has several types, with one of them being Bitcoin.Bitcoin is the cryptocurrency that first appeared.This digital currency was created by Laura and Alfreda in 2009 [4].This currency was once designated as the currency of the Comput Sci Inf Technol ISSN: 2722-3221  Implementing lee's model to apply fuzzy time series in forecasting bitcoin price (Yuniar Farida) 67 year and the best investment of the year.But Bitcoin was also named the worst currency when its price weakened [5].Bitcoin price fluctuations are closely related to global economic policies, including how a country is regulated, the perception of anticipation and panic among Bitcoin users, and the level of supply and demand for Bitcoin.Bitcoin prices rise in tandem with an increase in demand.The price of Bitcoin is hazy since there is a degree of doubt about its existence.So, we need a suitable method for predicting the future price of Bitcoin.A different approach that considers uncertainty is the fuzzy time series method, a fuzzy logic time series technique where fuzzy set theory and linguistic variables are used to estimate the object value [6]- [10].Fuzzy logic is used in the Fuzzy Time Series approach because of its benefits; the idea is simple to grasp and has adaptable reasoning [11].
The initial use of Song and Chissom's fuzzy time series approach, initially presented in 1993, was to forecast University of Alabama enrollment.This method was initially successful in solving forecasting problems.However, its steps are more complicated to understand [12].It caused Chen 1996 to improve the Song and Chissom models more simply.This model has become increasingly popular because of its simplicity [13].Furthermore, in 2009, Lee redeveloped this model in the same case study.The study's findings demonstrated that the Lee model's MSE value of 0.5% was superior to that of the Chen model [14].
Numerous studies have examined the use of Lee's model in fuzzy time series forecasting.For example, Pal and Kar's research [15] used Lee's model to predict the RSME values for the BSE, NYSE, and TAIEX stock exchanges, 136.04, 66.85, and 62.57, respectively.Using Lee's Fuzzy Time Series approach, Vamitha [16] predicted temperature data and obtained an AFER value of 1.21%.In research on natural gas price forecasting, Dodi et al. [17] found that Lee's model, the Fuzzy Time Series approach, had a lower error rate (MAPE value of 6.885%) than Chen's model.When projecting the stock price of Bank Syariah Indonesia, Arjuna et al. [18] used Lee's fuzzy time series approach and achieved an exceptional degree of accuracy, namely a MAPE of 2.28%.
According to the previous explanation, fuzzy predictions may be made using the fuzzy time series approach using the Lee model.Lee's fuzzy time series approach has often outperformed Chen's model in earlier research.Consequently, the author's purpose in this research is to forecast Bitcoin values for the next time utilizing Lee's fuzzy time series model technique with three orders.This research is intended to contribute to developing the Fuzzy approach in implementing the investment field that is useful for investors and the public as a consideration in maintaining, selling, or buying Bitcoin currency.

METHOD
Lee's model is one of numerous models available for the fuzzy time series approach.Fuzzy time series using lee's model is an advancement over many earlier models, including Cheng and Chen and Song and Chissom.Lee's model is almost identical to other fuzzy time series models in its final phases.However, there is a difference in the formation of the FLRG [19].Lee's model in constructing FLRG considers all relations interconnected and must be calculated because it affects the predictive value [20].The following are the steps that must be passed in working on Lee's FTS method [21]:

Determine the set universe (𝑼) from actual data
In this step, the universal set of speakers can be defined from (1): 1 and  2 maybe any positive values, while the smallest and most significant data are represented by   and   .
Finding the interval and the number of fuzzy sets   is the next step.This step starts with figuring out how far the speaker  universal is apart using (2): After obtaining the results from formula (2), it's continued by calculating the amount of difference (lag) absolute in each data with (3): where N is the quantity of data and  +1 , and   are the t-time and ( + 1) time data, respectively.The fuzzy set interval basis is computed using (4) and the mean result: Next, use Equation ( 6) to get the median value of the total number of fuzzy sets that have been produced.
Where   is the median value at the  ℎ fuzzy set, while   is the  ℎ fuzzy set.The third phase involves performing fuzzification on the data and determining the degree of membership of the fuzzy group to   depending on the number of fuzzy sets generated in the previous stage, after receiving the number of fuzzy sets and their intervals.Fuzzification is a process in fuzzy logic that converts input data whose values are definite into linguistic variables.The number of linguistic variables in the fuzzy set doesn't have specific limits.A fuzzy set at   is defined by its fuzzy set membership value, which may be reduced to 0, 0.5, and 1.The number of fuzzy sets is represented by the notation 1 ≤  ≤ .The definition of the fuzzy group's degree of membership to   is shown in (7): Based on Equation 7, the following fuzzy set definition is obtained: where the  ℎ fuzzy set is denoted by (i=1,2,3…,n)   ( = 1,2,3 … , ).Whereas the membership value of   in an   ( = 1,2,3, … ) is indicated by the "/" sign on the number, which has a value of 0, 0.5, or 1. Upon determining the level of affiliation between   and   , go on with the fuzzification procedure.

Fuzzy logical relationship (FLR)
The link between one data sequence and the subsequent data in a set is known as a fuzzy logical relationship, or FLR.Chen presented the n-order ideas of the high order fuzzy time series technique in 2002.The process calculation phases are identical to those of other Fuzzy Time Series techniques; the only distinction is figuring out the fuzzy logic relationship, or FLR.FLR connects the linguistic values established using the previously acquired fuzzification table [22].The formula for calculating FLR in this step is   →   , where   represents the current state  (−1) and A_j represents the following stage   .

Fuzzy logical relationship group (FLRG)
After the FLR procedure, each value   is combined into FLRG.Chen and Lee's model is one of several common approaches to determining the sequence of these FLRGs.This grouping process is what distinguishes the two models.Since no weighting is used to define relationships in a group, the exact relationship is considered one in Chen's model.Whereas in Lee's model, the same relation is not considered one.Lee claims this might impact the expected value; hence, the value must be computed [23].All FLRs in a fuzzy time series using Lee's model are combined to form an interconnected FLRG.Take   , for instance: Implementing lee's model to apply fuzzy time series in forecasting bitcoin price (Yuniar Farida)

Defuzzification
Defuzzification is the process of computing the forecasting output results to create precise numerical results, which are then combined with actual data from the prior period to produce the forecasting results.The middle value of each interval in the FLRG created in the last step was used to get the forecasted value.Defuzzification will replace the fuzzy output with a firm value based on the membership function to produce forecasting results [21].

Determine the forecasting accuracy value
One technique for determining the error value that is often used to gauge the error rate of a forecasting result is MAPE.This is due to the technique's ability to make it easier to understand the effects of the error value compared to other methods [24], [25].The MAPE error value is computed using the following formula [26]: The variables ,   , and   represent the quantity of data, actual data, and projected data, respectively.MAPE has several criteria for determining whether or not the method used in predicting the object is suitable.A MAPE of less than 10 is considered exceptional, while a MAPE of 10% to 20% is considered decent.MAPE under 50% is considered terrible, whereas MAPE between 20% and 50% is considered appropriate [27].

Data
This research uses secondary data obtained from the financial market platform, investing.com[28].The information collected on the website contains weekly Bitcoin price statistics from January 2019 to December 2021.The plot of Bitcoin price time series data from January 2019 to December 2021 can be seen in Figure 1.

Figure 1. The plot of bitcoin price time series
Figure 1 showed the weekly variations or fluctuations in the price of Bitcoin.The highest Bitcoin price occurred on November 7th, 2021 (149 th Period), which was 64398.6USD.Meanwhile, the lowest price occurred on January 27th, 2019 (4 th Period), which was 3502.5 USD.

RESULTS AND DISCUSSION
Choosing the speakers is the first stage in using Lee's fuzzy time series approach to predict the price of Bitcoin.U stands for the universal set of speakers, which is denoted by [  −  1 ,   +  2 ].In this case  1 and  2 are some corresponding positive numbers.Based on Bitcoin price data for January 2019 to December 2021, the highest price was 64398.6USD, while the lowest was 3502.5 USD.By obtaining the highest and lowest prices on Bitcoin price data, the researchers determined the values of  1 = 225.3and  2 = 316.2.So, the set of speakers (U) on the Bitcoin price ranges from 3277.2 USD to 64714.8USD.
From the results of U's universe interval, it can be seen that the length of the  interval is 61437.6.These results are then used to calculate the amount of difference (lag) absolute in each Bitcoin price data.The complete lag in each data is sought by calculating the fundamental difference between the past data in the  + 1 Period and the past data in the  Period.Next, the outcomes are divided by the total quantity of data minus 1.The consequences of the absolute lag are shown for each historical data point in The number of absolute lags in each historical data in Table 1 is 276014.6.These results are then used to calculate the complete mean lag in each historical data.In calculating the absolute mean lag value for each recorded data, Equation (3) can be used.So, the following mean value is obtained: The computed average value of the absolute difference (lag) for every data point is 1780.7,as determined using Equation (3).Next, Equation ( 4) is utilized to compute the fuzzy interval basis based on the outcomes of these computations.
The base interval value, as determined by calculations using Equation (4), is 890.4.Next, the number of fuzzy sets is ascertained by using the value of the primary interval.The quantity of fuzzy sets may be determined using Equation (5).
69 fuzzy sets are present, as can be shown from the computations' results using Equation (5).Then from each fuzzy set, which consists of 69 fuzzy sets, the middle value is searched using Equation (6).The following is an example of calculating the median value of the 1 st fuzzy set ( 1 ): The results using Equation (6) show that the median value of 1 st fuzzy set ( 1 ) is 3722.4.The process continues to find the median value up to the 69 th fuzzy set using the same method and formula.For every fuzzy set ( 1 ), For every fuzzy set created using Bitcoin price data, Table 2 displays the median value and the length of the class interval.The 1 st fuzzy set ( 1 ) has an interval length of 3277.2 to 4167.6.From the size of the interval, it has a median value of 3722.4.
Determining the degree of membership (  ) to (  ) is the next step.The degree of membership (  ) to (  ) is defined, considering the quantity of fuzzy sets acquired in the preceding stage.Subsequently, it is presumed that the linguistic variables' fuzzification value for the Bitcoin price data becomes  1 ,  2 ,  3 , ⋯ ,  69 .Equation ( 7) is used to define each set (  ) with  = 1,2,3, ⋯ ,69 against (  ).Thus, the fuzzy set (  ) that results is as follows: where the i th fuzzy set is denoted by   ( = 1,2,3 … , ).The membership value of   in an   ( = 1,2,3, … ) with a value of 0, 0.5 or 1. is indicated by the symbol "/" mentioned on the number.Conversely, the symbol (+) indicates the whole set of   items rather than the addition operation.Following steps (2.1-2.4) to predict Bitcoin Price using Lee's Fuzzy Time Series approach after determining the membership degree (  ) of (  ).

Fuzzification of bitcoin price
The fuzzification process is based on the results of defining the degree of membership   to   .Where the example illustration was the Bitcoin price data on January 6th, 2019 ( = 1), in Table 3 is 3597.2.The value lies in the interval  1 = [3277.2− 4167.6], then from the fuzzy set A, which has a membership degree of one in the set  1 is   1 (  ).So, the data ( = 1) is fuzzified into   Because the set   has a membership degree of one on   .Based on the example illustration, if it is implemented with other data, the fuzzification Bitcoin price as shown in Table 3.

Fuzzy logical relationship (FLR)
The fuzzyfication findings in Table 3 may be used to create a FLR.The formation of FLR can use several orders to obtain more accurate results.This is because the more orders are used, the more precise the results are obtained.However, the increasing number of orders used also has shortcomings, namely allowing the emergence of a fuzzy set not found in the FLRG (Fuzzy Logic Relationship Group) and causing no further forecasting to be carried out.
The expression for the generation of FLR order one is   →   , where   represents the set of prior observations (( − 1)) on the left side, and   represents the set of observations (()) on the right side about the price data of Bitcoin.To determine the first-order FLR, the provisions of  (−1) →   are used.The illustration, for example, is as follows, in the fuzzification of Bitcoin price data in the current state  = 1 is  1 while the next state  = 2 is  1 , therefore the FLR form of the two data is  1 →  1 .The following Table 4 displays the outcomes of FLR order one formation: Following that, the second-order FLR may be expressed as follows:   ,   →   , where   and   are the two prior observations (( − 1)),   is the observation made following the prior data (()) on Bitcoin price data.To determine the first-order FLR, the provisions of  (−2) ,  (−1) →   are used.An example illustration is as follows: the fuzzification of Bitcoin price data at the current state  = 1 is  1 and current state  = 2 is  1 , while the next state  = 3 is  1 , therefore the FLR form of the three data is  1 ,  1 →  1 .Table 5 displays the outcomes of the second-order FLR formation:

Fuzzy logical relationship group (FLRG)
First-order FLRG can be formed by utilizing the results of first-order FLR listed in Table 4. Fuzzification is first grouped with the same current state ( (−1) ), and then grouped into one group in the next state (  ), to construct a first-order FLRG.Group 3's FLRG, for instance, consists of  3 →  3 ,  3 →  3 ,  3 →  4 and  3 →  5 .The four FLR can be grouped into 1 FLRG, namely  3 → 2  3 ,  4 ,  5 .FLRG in other groups can be processed with the same steps previously mentioned.Table 6 displays the formation first order FLRG findings.
The findings of the second-order FLR may then be used to generate the second-order FLRG, as shown in Table 5. Fuzzification, which contains two current states ( (−2) ,  (−1) ), is gathered into one group in the next state (  ) to generate the second-order FLRG.For example, group 88's FLRG is  66 ,  66 →  66 ,  66 ,  66 →  66 .The two FLRs can be grouped into 1 FLRG, namely  66 ,  66 →  66 ,  69 .FLRG in other groups can be processed with the same steps previously mentioned.

Defuzzification
At this defuzzification stage, the first-order forecasting results are based on the FLRG formation in Table 6, which has 45 groups.The defuzzification first-order FLRG results in the second group were 5058.0.The result is obtained by adding half of the median values (  )  2 and  3 .The calculation can be written as 3 .From these calculations, the result of defuzzification in the second group was 5058.0.Defuzzification in other groups can be processed with the same steps previously mentioned.Table 8 shows the defuzzification of the forecasted outcomes by the 45 groups formed:  Figure 2 shows a plot comparing the actual data of Bitcoin Price with the results of order one forecasting.A blue line represents the main Bitcoin Price data plot, while a red line represents the Bitcoin Price forecasting data plot.The graph demonstrates how the data pattern of the forecasting results produced by the Fuzzy Time Series Lee technique of order 1 closely resembles the actual data on the bitcoin price.Next, to obtain a second-order forecasting result is based on the FLRG formation in Table 7, which has 90 groups.As a consequence, Table 10 displays the defuzzification of the 90 groups' predicted results: The final forecasting results for Bitcoin prices from January 2019 to December 2021 are obtained from the second-order FLRG group defuzzification results in Table 10.For example, the calculation of the forecast results on January 20th, 2019, has a current state of January 6 and 13, 2019.Based on Table 4, The fuzzification on January 20th, 2019 is  1 , while the fuzzification on January 6 th and 13 th , 2019 is  1 .Besides that, based on Table 5, the FLR formed from the results of the fuzzification is  1 ,  1 →  1 .Thus, with predicting results of 3803.3,Table 8 indicates that the FLR results belong to group 1 defuzzification.Table 11 presents the outcomes of second-order forecasting on Bitcoin price data in greater detail.Finding the FLR from the previous period with the far left and far right sides, which matches the established FLRG, will help determine the predicted outcomes for the next period.As an example, on December 26, 2021, the Bitcoin price FLR created is  49 ,  53 →  50 , so that on January 2 nd, 2022, the resulting FLR form is  53 ,  50 → #.From the FLR form, it can be concluded that the second order cannot be predicted for January 2 nd , 2022. Figure 3 presents the final forecasting predictions for Bitcoin prices from January 2019 to December 2021, which are derived from the second-order FLRG group defuzzification findings: Figure 3. Plot comparing real data bitcoin price with predicted outcomes, order 2 Figure 3 shows a comparative plot of actual data of Bitcoin Price with 2nd order forecasting results.The graphic illustrates how the plot of predicting results produced by the Fuzzy Time Series Lee technique of order 2 closely resembles the actual data on the bitcoin price.

Determine the forecasting accuracy value
The level of forecasting accuracy is used to determine the goodness prediction results.This research uses the MAPE approach to determine the forecasting accuracy level.The outcome of computing the MAPE value for Bitcoin price data for every order is shown in Table 12.Based on Table 12, it's obtained that the second order has the smallest MAPE value, which is 4.042%.While in the first order, the resulting MAPE value is 5,419%.These values are categorized according to excellent criteria.

DISCUSSIONS
The forecasting results in this research are shown in Table 9 (for order 1), and Table 11 (for order 2) with the MAPE as shown in Table 12.Actually, the best forecasting results are formed by Lee's Fuzzy Time Series order 2. But, in order 2, the relation in the period January 2nd, 2022 isn't found in the groups determined previously of FLR.So, the forecast for the next period uses order 1.Besides that, the study's results show that using more than one order can produce more accurate results.On the other hand, using more than one order also has drawbacks; namely, it allows the emergence of fuzzy sets not contained in the FLRG, so forecasting cannot be done in the next Period.
Pannu and Tripathi [29] have also conducted research on the usage of the Fuzzy Time Series technique with many orders, forecasting daily temperature in Taipei using up to eight orders in their study; the order that has the best accuracy rate is the fifth order, with an average RMSE value of 1.25.Tricahya and Rustam [30]  ISSN: 2722-3221 Comput Sci Inf Technol, Vol. 5, No. 1, March 2024: 66-77 76 forecast the number of Pneumonia sufferers in Jakarta using three orders.The results obtained in his research indicate that the method is excellent to use because it produces a MAPE value of 9.70%.Using two orders and the goal of counting the number of registrants at the University of Alabama, Burney et al. [31] used the Fuzzy Time Series approach.The results show that this method has a MAPE value of 0.52%.

CONCLUSION
Forecasting the price of Bitcoin, this research used Lee's model in conjunction with the Fuzzy Time Series approach, and the results were achieved on January 2 nd , 2022, amounting to 53584.8USD using the first order.The evaluation of the performance of this method is excellent, with a MAPE value of 5.419%.Meanwhile, implementing second-order forecasting cannot be carried out in the next period even though it has a smaller level of accuracy (4.042%).The relations generated in the January 2 nd , 2022, period are not found in the groups previously determined in the second order FLRG.This research is intended to contribute to developing the Fuzzy approach in implementing the investment field that is useful for investors and the public as a consideration in maintaining, selling, or buying cryptocurrency.
5), one may determine the number of fuzzy sets based on the interval length () and interval basis () findings.

Table 1 Table 1 .
Lag absolute value of bitcoin price

Table 2 .
Table 2 displays the results, the median value, and the interval length: Interval length and median value of bitcoin price fuzzy set Implementing lee's model to apply fuzzy time series in forecasting bitcoin price (Yuniar Farida) 71

Table 4 .
FLR order 1 of bitcoin price

Table 5 .
FLR order 2 of bitcoin price

Table 6 .
Table 7 displays the outcomes of the creation of the second-order FLRG.FLRG order 1 of bitcoin price Implementing lee's model to apply fuzzy time series in forecasting bitcoin price (Yuniar Farida) 73

Table 8 .
Deffuzyfication of forecasting results order 1 of bitcoin price

Table 9 and
Figure 2 provide the final forecasting predictions for Bitcoin prices from January 2019 to December 2021, derived from the first-order FLRG group defuzzification results:

Table 9 .
Forecasting results order 1 of bitcoin price

Table 10 .
Deffuzyfikasi of forecasting results order 2 of bitcoin price

Table 11 .
Forecasting results order 2 of bitcoin price Implementing lee's model to apply fuzzy time series in forecasting bitcoin price (Yuniar Farida) 75

Table 12 .
The forecasting accurate