Chen and Cheng’s Model on The Fuzzy Time Series Method for Forecasting the Number of Honda Motor Sales

Model Chen dan Model Cheng pada Metode Fuzzy Time Series untuk Peramalan Jumlah Penjualan Motor Honda
Blanja.com

السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ readers !!! Alhamdulillah hopefully always healthy and happy. Well, on this occasion I will make an article about forecasting using the Fuzzy Time Series . Do you know ?

Fuzzy Time Series

Fuzzy time series is a data forecasting method that uses fuzzy principles as the basis. Forecasting using fuzzy time series can capture patterns from past data and then use it to project future data. (Ujianto and Irawan, 2015)
Fuzzy time series is a data forecasting method that uses basic fuzzy principles developed by L. Zadeh which was later developed by Song and Chissom in 1993 to solve problems with predicting new student registrations with time series data. Then the models from Song and Chissom were further developed by Chen by utilizing arithmetic operations to solve problems with the same case. Forecasting using the fuzzy time series method captures patterns from past data and then is used to project future data (Berutu, 2013).

Chen’s Model

The group of all results from fuzzy logic relations. For example, (Ai): Ai → Aj1, Ai → Aj1 and Ai → Aj2. Of the three fuzzy logic relations can be grouped. With the Chen model and will produce Ai → Aj1, Ai → Aj2, where the relation Ai → Aj1, Ai → Aj1, just take one, because the two relations are considered the same.

Cheng’s Model

Chen’s algorithm has several drawbacks, namely not considering the existence of repetition and the absence of weighting which is getting smaller in the longer the observation. Some people then tried to improve Chen’s algorithm. According to Cheng, et al (2008), the differences in these methods are found in the steps of fuzzy set formation and there are weights in each group of fuzzy relations.

Steps of Fuzzy Time Series

At this time, I used data on the number of Honda Motor sales to be forecasted with Fuzzy Time Series. You can get the data here. Here I will use two models, namely the Chen’s model and Cheng’s model from the Fuzzy Time Series. So, let’s just try …

Using R (Chen’s Model)

Install and Call Packages

library(AnalyzeTS)

Call Data

honda=read.csv(“D:\\LECTURE\\Analisis Runtun Waktu\\Fuzzy\\Data Penjualan Motor.csv”, sep=”;”)
honda

Know the smallest and largest data value

minimal=min(honda$Honda)
minimal
maksimal=max(honda$Honda)
maksimal

In this data on the number of Honda motor sales, it is known that the smallest value is 203659, and the largest value is 458499. Based on the minimum and maximum values, I can determine the values of D1 and D2. Where the value of D1 = 9 and the value of D2 = 1. These D1 and D2 values are used to determine the new minimum and maximum values.

D1=9
D2=1
min.baru=minimal-D1
max.baru=maksimal+D2
min.baru
max.baru

So, the new minimum value is 203650, and the new maximum value is 458500.

Determine the Number of Classes (n)

n=1+3.332*log10(43)
n

The value of 43 in the formula above is the amount of data. Then, the value of n is 6.442717, which is rounded to 6.

Form a Time Series Data

honda.ts=ts(honda$Honda, start=c(2015,1), frequency=12)
honda.ts

Chen’s prediction

chen=Gfuzzy.ts1(honda.ts,D1=9,D2=1,n=6,type=”Chen”,plot=TRUE,grid=TRUE)
chen
Chen’s Prediction

Chen’s prediction results are obtained like the output results above. Prediction results show from February 2015 to July 2018. You can also see the visualization of the prediction plot as shown below.

Fuzzy Time Series Plot

Use Microsoft Excel (Cheng’s Model)

Determine minimum, maximum, D1, D2, number of classes, class length, new minimum and maximum.

Number of classes (Jumlah Interval) =ROUND(1+3.332*LOG10(data);0)
Class lenght (Panjang Interval) =ROUND((max baru-min baru)/Jumlah Interval;0)
The new minimum value is 203650 which is obtained from the minimum value minus the value D1, and the maximum value is 458500 which is obtained from the maximum value plus the value of D2.

Determine the upper and lower limits, and the middle values.

Lower limit (Batas bawah) 
Class 1 = new minimum value
Class 2 = Lower limit of class 1 + class length
Class 3 = Lower limit of class 2 + class length
Class 4 = Lower limit of class 3 + class length
Class 5 = Lower limit of class 4 + class length
Class 6 = Lower limit of class 5 + class length
Upper limit (Batas Atas)
Class 1 = Lower limit of class 2 -1
Class 2 = Upper limit of class 1+ class length
Class 3 = Upper limit of class 2 + class length
Class 4 = Upper limit of class 3 + class length
Class 5 = Upper limit of class 4 + class length
Class 6 = Upper limit of class 5 + class length
Middle Value (Nilai Tengah)
(Lower limit class + Upper limit class):2

Fuzzyfication
Fuzzyfication

Fuzzyfication is obtained from the original data and the lower limit. The author uses the IF function in Excel to simplify the process. You can see it as shown below.

Determine FLR (Fuzzy Logical Relationship)

For example, F (i) = Ai and F (i + 1) = Aj. The relationship between the two observations in sequence, F (i) and F (i + 1) becomes F (i) → F (t + 1), called the fuzzy logic relation, denoted by Ai → Aj, where Ai is called LHS ( Left Hand Side) or current data and Aj called RHS (Right Hand Side) or the next data.

Fuzzy Logical Relationship
Make a Pivot Table

Creating a Pivot table from the LH and RH columns that have been made is blocked first, then select insert >> pivot table >> LH and RH checklist >> drag LH and RH to the value column >> OK

Pivot Table

Based on the pivot table above, I form a new column for the Current State, Next State, and so on columns, which are then used to predict the Cheng’s model.

Cheng’s prediction
Cheng’s Prediction

Make Cheng predictions based on the number of classes. Here is the formula for Cheng’s prediction for each class (Row Labels). 
G1(A1)=(Count of LH A5/Count of LH A1)*Middle Value A5
G2(A2)=(Count of LH A4/Count of LH A2)*Middle Value A4+(Count of LH A5/Count of LH A2)*Middle Value A5+(Count of LH A6/Count of LH A2)*Middle Value A6
G3(A3)=(Count of LH A4/Count of LH A3)*Middle Value A4
G4(A4)=(Count of LH A2/Count of LH A4)*Middle Value A2+(Count of LH A3/Count of LH A4)*Middle Value A3+(Count of LH A4/Count of LH A4)*Middle Value A4+(Count of LH A5/Count of LH A4)*Middle Value A5+(Count of LH A6/Count of LH A4)*Middle Value A6
G5(A5)=(Count of LH A1/Count of LH A5)*Middle Value A1+(Count of LH A2/Count of LH A5)*Middle Value A2+(Count of LH A4/Count of LH A5)*Middle Value A4+(Count of LH A5/Count of LH A5)*Middle Value A5+(Count of LH A6/Count of LH A5)*Middle Value A6
G6(A6)=(Count of LH A2/Count of LH A6)*Middle Value A2+(Count of LH A3/Count of LH A6)*Middle Value A3+(Count of LH A4/Count of LH A6)*Middle Value A4+(Count of LH A5/Count of LH A6)*Middle Value A5+(Count of LH A6/Count of LH A6)*Middle Value A6

Determine FLRG (Fuzzy Logical Relationship Group)

The value of each relationship that has been obtained will be combined or commonly referred to as FLRG (Fuzzy Logical Relationship Group). The way of grouping is from the same left side. The author also uses the IF function to simplify work. You can see in the picture below.

Fuzzy Logical Relationship Group
Cheng’s prediction based on data

After getting Cheng’s prediction on each class and making FLRG (Fuzzy Logical Relationship Group), then I will make predictions based on data. I use the IF function in Excel to make predictions. You can see Excel formulas like the picture below.

Cheng’s Prediction
Mean Absolute Percentage Error (MAPE)

The method of calculating between original data and forecasting data. The difference is validated, then calculated into the percentage of the original data. The results of the percentage are then obtained by the mean value.

yt : actual value in the t-period
n : number of samples
ybar t : forecast value in the t-period

Based on the formula, the MAPE value obtained in Cheng’s prediction is 15.8% and the MAPE value in Chen’s prediction is 16.7%.

Because the MAPE value in Cheng’s prediction is smaller than the MAPE value in Chen’s prediction, it can be said that Cheng’s Model is the best model in forecasting this case. Forecasting results are said to be very good if the MAPE value is less than 10%. However, when it has a MAPE value of less than 20% it can also be said to be good.

You can get an Excel file (csv)that has been analyzed here.

Demikian artikel yang dapat Saya bagikan pada kesempatan kali ini, yaitu tentang Fuzzy Time Series untuk meramalkan Jumlah Penjualan Motor Honda. Semoga tulisan artikel ini dapat bermanfaat bagi readers. Apabila terdapat kesalahan dalam analisis maupun penulisan bahasa, Saya mohon maaf 🙏 Saya sangat-sangat menerima saran, kritik dan masukan apapun demi yang lebih baik lagi untuk tulisan-tulisan artikel Saya ke depannya. Thank you for reading. See you in the next my article !!!
 وَ السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ

References

Berutu, S. S., 2013. Peramalan Penjualan Dengan Metode Fuzzy Time Series Ruey Chyn Tsaur. Tesis, Universitas Diponegoro, Semarang.
Febriana, E.T., 2018. FUZZY TIME SERIES CHEN ORDE TINGGI UNTUK MERAMALKAN JUMLAH PENUMPANG DAN KENDARAAN KAPAL. Tugas Akhir, Universitas Islam Indonesia, Yogyakarta.
Prayogi, A.R., 2018. DEMAND FORECASTING PENGGUNAAN ENERGI LISTRIK (KWH) MENGGUNAKAN FUZZY TIME SERIES CHENG. Tugas Akhir, Universitas Islam Indonesia, Yogyakarta.
Ujianto, Y., dan Irawan, M. I. 2015. Perbandingan Performansi Metode Peramalan Fuzzy Time Series yang Dimodifikasi dan Jaringan Syaraf Tiruan Backpropagation (Studi Kasus: Penutupan Harga IHSG). Jurnal Sains dan Seni ITS. Vol. 4, №2, Hal. 31–36.

Widi, T.A., 2018. PERBANDINGAN MODEL CHEN DAN LEE PADA METODE FUZZY TIME SERIES UNTUK PREDIKSI HARGA SAHAM BANK BRI. Tugas Akhir, Universitas Islam Indonesia, Yogyakarta.