1 Introduction

Time series forecasting is the process of future observation prediction through the critical analysis of historical data. To predict future observations, the models are built and observations are made on historical data. There are many existing classical forecasting models such as linear regression, exponential smoothing, moving average models which work on basic assumption that the time series is stationary. But in real life situations, time series are complex in nature due to the fact that at times there is uncertainty in data. This uncertainty in data could also be possible due to inaccuracy in data. To handle the uncertainty in data, fuzzy set theory is an effective tool. A fuzzy set theory was proposed by Zadeh (1965) in which the linguistic terms are used for uncertain observations. Later, this theory was utilized in time series forecasting and termed as fuzzy time series (FTS). FTS forecasting models are dynamic in nature due to their rule-based structure.

Song and Chissom (1993a) proposed the concept of FTS with both the time-invariant and time-variant models and applied it to the enrollment of University of Alabama. The model proposed by Song and Chissom (1993b, 1994) uses the max–min operation that is computationally expensive. Then, Chen (1996) proposed a model using simple arithmetic operations that became popular among researchers. Since then a lot of significant work has been done towards the improvement of forecasting accuracy. The following are the major steps in the process of modeling fuzzy time series forecasting: (1) Defining and partitioning of Universe of Discourse (UoD), (2) Process of fuzzification, (3) Rule base construction and (4) Forecasting and defuzzification process. Numerous novel models have been proposed and tested till now in diverse problem domains such as enrollment (Bisht and Kumar 2021), crop production (Singh and Borah 2014), stock market (Goyal and Bisht 2021), load forecasting (Sadaei et al. 2019) and shipping market time series (Gao et al. 2021).

Various models have been proposed in which different partitioning techniques are employed. In the partitioning process, the length of the interval is an important parameter. Some researchers have considered equal lengths of intervals while others have taken unequal lengths of intervals. Initially, Song and Chissom (1993b, 1994) and Chen (1996, 2002) gave the forecasting model using equal lengths of intervals. However, the impact of interval length was investigated by Huarng (2001). He gave the distribution and average based techniques whereas Huarng and Yu (2006) gave ratio-based technique to obtain length of interval. In the process of partitioning, along with arithmetic approaches, evolutionary algorithms have also been used to optimize the length (Lee et al. 2008; Kuo et al. 2009; Eğrioğlu 2012; Duru and Bulut 2014; Egrioglu et al. 2019; Zeng et al. 2019). The most commonly used evolutionary algorithms are genetic algorithms (GA) and particle swarm optimization (PSO). Many authors applied them in the fuzzy time series forecasting model in different processes such as partitioning of UoD, fuzzification of data points and construction of the rule base (Chen and Wang 2010; Aladag et al. 2012; Chen and Jian 2017; Chen and Phuong 2017; Chen et al. 2019; Pant and Kumar 2021a, b). Eğrioğlu (2012) proposed a time-invariant model that used both FCM and GA, whereas Aladag et al. (2012) proposed a time-invariant model that used both FCM and PSO. When the results of these two models are compared, it is clear that the model with PSO outperforms the model with GA. But for respective evolutionary algorithms, how parameters affect the FTS model has not been investigated. For this study, we have focused on PSO for the following reasons: PSO has an in-built guidance strategy, which results in faster convergence of PSO solutions, whereas GA does not have such a mechanism. PSO stores the previous best solutions obtained by each particle in memory, making the algorithm very robust. GA, on the other hand, does not use memory to keep track of solutions across generations. In process of fuzzification, the crisp values are converted to fuzzy sets. The impact of different fuzzy sets in fuzzy time series modeling has been observed by Bisht and Kumar (2016), Egrioglu et al. (2019) and Guan et al. (2019). Some researchers employed clustering algorithms to find clusters along with membership of each data point (Li et al. 2008; Askari and Montazerin 2015). Rule base is determined to identify the pattern of the time series. Different structures have been proposed in the literature for the identification of fuzzy logical relationships (FLR). Song and Chissom (1993b, 1994) gave the rule base in matrix form whereas Markov transition matrix was employed by Sullivan and Woodall (1994). Artificial neural network (ANN) and its variants have been used for the identification of FLR in the FTS model (Huarng and Yu 2006; Aladag et al. 2009; Singh 2018). While determining the rule base, the order of FTS plays an important role. The order of FTS boosts the accuracy of the model. This was tested by Chen (2002) in his extended work of Chen (1996). Thereafter, multiple researchers have used fixed high-order fuzzy time series to improve the model’s accuracy (Aladag et al. 2009; Egrioglu et al. 2010; Panigrahi and Behera 2020). Generally, it was found that higher the order, better is the accuracy. But then arises the issue of over fitting on a training data set. The most common approach used for the process of defuzzification, i.e., reverse process fuzzification, is centroid method (Chen 1996; Huarng 2001).

From the above study, it has been observed that very less work is done in time-variant FTS models and appropriate partitioning technique along with order of FTS is still a challenging task. Also, for hybrid FTS models, how parameters of evolutionary algorithm affects FTS model has not been investigated. The present study presents a model that accommodates the following research objectives:

  1. 1.

    Partitioning technique and selection of appropriate order

  2. 2.

    Efficiency of model and

  3. 3.

    Optimal forecasting error.

A computationally robust model is proposed by combining particle swarm optimization and dynamic order algorithm. For partitioning of universe of discourse, particle swarm optimization is used as it has fewer parameters when compared with other nature inspired optimizations. Our study is about the effect of parameters of PSO when applied in fuzzy time series for optimization of partitioning of universe of discourse. Also, study on its parameters is done when PSO is combined with FTS model. And for the selection of an appropriate order, a dynamic order algorithm is used to auto-adjust the order of FTS model (Wagner et al. 2007). Also, proposed model minimizes the search for suitable defuzzification process.

The organization of the paper is done in the following ways: Basic definitions of FTS are defined in Sect. 2. Sections 3 and 4 describe particle swarm optimization and dynamic order algorithms, respectively. The proposed model is described in detail in Sect. 5. In Sect. 6, the model is tested on different frequency data sets and empirical study is presented in it. Finally, Sect. 7 is the conclusion.

2 Fuzzy time series

FTS is the concept proposed by Song and Chissom (1993a, b, 1994) based on fuzzy theory for the forecasting of time series. It can handle the forecasting of linguistic variable problems. The basic definitions are discussed below:

Definition 1

Let U be the UoD, where \(U=\{{\mathfrak{u}}_{1},{\mathfrak{u}}_{2},\ldots , {\mathfrak{u}}_{\mathrm{n}} \}\) on which fuzzy sets are defined as

$$A_{j} = \frac{{\mu_{{A_{j} }} \left( {{\mathfrak{u}}_{1} } \right)}}{{{\mathfrak{u}}_{1} }} + \frac{{\mu_{{A_{j} }} \left( {{\mathfrak{u}}_{2} } \right)}}{{{\mathfrak{u}}_{2} }} + \cdots \frac{{\mu_{{A_{j} }} \left( {{\mathfrak{u}}_{n} } \right)}}{{{\mathfrak{u}}_{n} }},$$
(1)

where, \(\mu_{{A_{j} }} \left( {{\mathfrak{u}}_{n} } \right) \in \left( {0,1} \right)\) is membership degree of \({\mathfrak{u}}_{n}\) in \({A}_{j}\). Then the collection of fuzzy sets \({A}_{j}\) is known as FTS on U, represented by F(t).

Definition 2

Let F(t) be the FTS and ℜ (tt − 1) be a fuzzy relation, then F(t) = F(t − 1) ○ ℜ (tt − 1) where ‘○’ is an operator means F(t) is caused by F(t − 1), represented by F(t − 1) → F(t). It is known as first-order FTS and if F(t) is caused by F(t − 1), F(t − 2), …, F(t − m) m > 0, it is known as mth-order FTS which is represented by F(t − 1), F(t − 2), …, F(t − m) → F(t).

Definition 3

If for any time t, the fuzzy relation ℜ (t, t − 1) or ℜ (t, t − m) is independent of t, then F(t) is termed as the time-invariant FTS, else time-variant FTS. Here, independent of t means at different times t1 and t2, ℜ (t1, t1 − 1) = ℜ (t2, t2 − 1) or ℜ (t1, t1 − m) = ℜ (t2, t2 − m).

Definition 4

Let F(t) be time-variant FTS, then relation is expressed as F(t) = F(t − 1) ○ ℜd (tt − 1), where d is the order of the FTS model which affects the forecast.

3 Particle swarm optimization

Kennedy and Eberhart (1995) proposed an optimization algorithm that mimics the swarm behavior known as particle swarm optimization (PSO). This optimization technique has an advantage over other nature inspired optimization techniques as it has few parameters, which makes it easy to implement. Also, in the process, no assumptions are required to handle the specific task, and it is computationally less expensive. PSO is an iterative process that uses the velocity displacement model to optimize a problem.

Initially in the algorithm, particles (solutions) are randomly generated with randomized velocity within the search space. The velocity and position of these particles are then updated in each iteration, keeping track of both the global and local best solutions until the termination criteria are met. These solutions are updated according to the following two equations:

$${v}_{i}(t+1) =w* {v}_{i }(t+1)+{c}_{1} {r}_{1} ({p}_{i}^{l}(t)-{p}_{i}(t))+{c}_{2}{r}_{2} ({p}_{i}^{g}(t)-{p}_{i}(t)),$$
(2)
$${p}_{i}\left(t+1\right)={p}_{i}\left(t\right)+{v}_{i}\left(t+1\right),$$
(3)

where w is the inertia weight, \({c}_{1}\) is the cognitive coefficient and \({c}_{2}\) is the social coefficient, \({r}_{1}\) and \({r}_{2}\) are randomly generated numbers in the range [0, 1]. In Eq. (2), \({c}_{1 } {r}_{1} \left({p}_{i}^{l}\left(t\right)-{p}_{i}\left(t\right)\right)\) is the personal influence and \({c}_{2}{r}_{2} ({p}_{i}^{g}(t)-{p}_{i}(t))\) is the social influence. The algorithm works with static values \({c}_{1}\) and \({c}_{2}\) with their sum equal to 4. Since \({c}_{1}\) and \({c}_{2}\) determine the inclination of search, a higher value of \({c}_{1}\) means greater local search ability, whereas a higher \({{c}}_{2}\) means greater global search ability. So, they are generally assumed to be equal in keeping away divergence and cyclic behavior. To avoid the quick convergence of solutions, \({{r}}_{1}\) and \({{r}}_{2}\) are used. Premature convergence may occur if the inertia weight is chosen incorrectly, as its role is to explore and exploit. The value of w is problem dependent and lies between 0 and 1.

4 Dynamic order algorithm

This paper proposes a dynamic order PSO-based fuzzy time series model to auto-adjust the order of fuzzy time series and partition the UoD. The selection of the order is important to any forecasting model's success. When the forecasting problem is not well understood, automatic determination of this window size is essential. The dynamic order algorithm automatically adjusts its window size with each slide of the window. The dynamic approach used in this paper to select the appropriate order was proposed by Wong et al. (2010). In each round of the training phase, the order is adjusted dynamically. This is done in the following manner.

  1. 1.

    Initialized by taking \(i=1\) and \(n=1\).

  2. 2.

    Then, two orders are selected as \(n\) and \(n+i\), and the flag h = n, where both \(n\) and \(i\) are positive integers.

  3. 3.

    With the selected two orders, the next data point is forecast using the proposed model. Both orders’ predictive accuracy (PA) is computed using Eq. (4) (\({\mathrm{PA}}_{n}\) and \({\mathrm{PA}}_{n+i}\)). Best solution among these two will be selected to predict next order and flag.

    $$\text{Predictive Accuracy}=\left|\text{actual value}-\text{forecasted value}\right|.$$
    (4)
  4. 4.

    Now select two more window sizes based on which one had the best accuracy. If \({\mathrm{PA}}_{n}\le {\mathrm{PA}}_{n+i}\), two new orders are created: \(n\) and \(n-i\), with flag h equal to \(n-i\). If \(n=0\), then the process starts from the initial step. If \({\mathrm{PA}}_{n}<{\mathrm{PA}}_{n+i}\), two new orders are created: \(n+i\) and \(n+2i\), with flag h equal to \(n+i\).

  5. 5.

    To include the next time series observation, slide the h to the right. Use the two new orders obtained to run two more dynamic generations, predict future data, and assess their accuracy.

  6. 6.

    This process is repeated till the sequence of flags is obtained for all historical data.

5 Proposed model

In this paper, a computational FTS model is presented in which PSO is used to search for the optimal partitioning of UoD and a dynamic order approach has been used for the order selection of FTS. PSO is employed to optimize the length of interval by determining the boundary points of interval because optimization of interval length has a great impact on the fuzzification process and the accuracy of results. The problem of selecting an appropriate order for the model is resolved using a dynamic order approach in which a sequence of orders is obtained in training algorithm and then in the forecasting algorithm, the order is selected from this sequence based on certain rules. The methodology consists of two phases which involve pre-processing, defining and partitioning of the UoD, fuzzification, and construction of the rule base, forecasting and defuzzification. The steps of the proposed model are explained below and also explained using flowchart (Fig. 1).

Fig. 1
figure 1

Flowchart of proposed model

Phase 1: Pre-processing, defining and partitioning of UoD, fuzzification, construction of rule base

Step 1 The process is initiated by checking the outliers in the time series using the generalized extreme studentized deviate (ESD) test, an extension of the Grubbs test (Grubbs 1950). And the outliers found are replaced using linear interpolation.

Step 2 Define UoD based on range values of the data series defined by U,

$$U=\left[{X}_{\mathrm{lb}} , {X}^{\mathrm{ub}}\right],$$
(5)

where \({X}_{\mathrm{lb}}={X}_{\mathrm{min}}-\mu\), \({X}^{\mathrm{ub}}={X}_{\mathrm{max}}+\mu\) and \(\mu = \frac{{\sum }_{i=1}^{n}|{X}_{i+1}-{X}_{i}|}{n-1}\) , \(n\) is the total number of data points.

Step 3 U is now partitioned into \(m+1\) intervals: \({i}_{1}, {i}_{2}, \dots ,{i}_{m+1}\) using PSO. The optimal partition vector \(P=[{p}_{1},{p}_{2}, {p}_{3}, \ldots ,{p}_{m}]\) is obtained to get the optimal partition of intervals \({i}_{1}, {i}_{2}, \ldots ,{i}_{m+1}\) where \({i}_{1}=[{X}_{\mathrm{lb}}, {p}_{1}]\),\({i}_{2}=[{p}_{1}, {p}_{2}]\) \({i}_{3}=[{p}_{2}, {p}_{3}]\), …, \({i}_{m+1}=[{p}_{m}, {X}^{\mathrm{ub}}]\) from the following procedure. The parameter values are taken as \({c}_{1}={c}_{2}=2\), inertia weight is varied in range 0–1 and the fitness function is root-mean-squared error (RMSE).

Step 3.1 Initially, \(m\) particles are generated with position vectors and velocity vectors randomly.

Step 3.2 Calculate the RMSE of each particle.

Step 3.3 Next, if RMSE of each particle's current position is better than its personal best position vector, then personal best position is updated.

Step 3.4 Particle having least RMSE is chosen as the best particle.

Step 3.5 Now the elements of velocity vector are updated based on Eq. (2) and position vector's elements are updated based on equation Eq. (3).

Step 3.6 The process from steps 3.2 to 3.5 is repeated until the termination criteria are satisfied. Here, the process is terminated when the number of iteration reaches the predefined value.

Step 4 Once \(m\) particles are obtained, \(m\)+1 intervals are formed and based on it, m triangular fuzzy sets are defined.

Step 5 Fuzzify the data and establish the fuzzy logical relation between time t and t + 1 as \({A}_{i}\to {A}_{j}\) in training phase and \({A}_{i}\to \#\) in forecasting phase.

Phase 2: Forecasting and defuzzification

Step 6 Now in this step, we have training phase and forecasting phase algorithm.

Step 6.1 In training phase, for each data, two orders are determined using dynamic order algorithm and then forecasted values for those two orders are determined with the help of training algorithm. Based on forecasting accuracy, the one with higher accuracy is selected. Dynamic order algorithm is initialized by taking \(i=1\) and \(n=1\).

Following are the notations used in both training and forecasting algorithms:

  • Ik represents kth interval

  • X(t) is the actual data value at time t

  • [lAk] defines the lower bound of interval Ik

  • [mAk] defines the middle value of interval Ik

  • [uAk] defines the upper bound of interval Ik

  • Y(t + 1) is forecasted value at time t + 1

  • h is the dynamic order

  • c is count; s is sum and d is deviation

  • +RN, RN, +PN, PN are fuzzy predictors

  • p is number of steps to be computed.

    figure a

Step 6.2 From the training phase algorithm, the sequence of order is obtained reflecting the trend of prediction. In forecasting phase, the forecasting algorithm forecasts two values, where the order and forecasted value is determined by undermentioned rules, considering sequence of flags.

  1. 1.

    If ht = 1, then order selected for time t + 1 is 1 and 2.

  2. 2.

    If ht = k and ht ≥ ht−1, then order selected for time t + 1 is k and k + 1.

  3. 3.

    If ht = k and ht ≤ ht−1, then order selected for time t + 1 is k and k − 1.

  4. 4.

    If ht ≥  ht-1 and Xt ≥ Xt−1, then Yt+1 is max of two forecasted values.

  5. 5.

    If ht < ht-1 and Xt < Xt−1, then Yt+1 is min of two forecasted values.

  6. 6.

    If ht ≥ ht-1 and Xt ≤ Xt−1 or ht ≤ ht−1 and Xt ≥ Xt−1, then Yt+1 is mean of two forecasted values.

figure b

6 Empirical study

In this paper, the model is tested on seven datasets which includes the benchmark data set of enrolments of Alabama University and the Taiwan stock exchange capitalization weighted stock index (TAIEX) and also West Texas Intermediate (WTI) crude oil prices. The data set of enrolments of Alabama University is yearly data whereas dataset of TAIEX is daily dataset and WTI crude oil prices dataset is monthly dataset. The descriptive statistics of each dataset is briefly described in Table 1. The comparison of proposed FTS model with the existing models is done in terms of RMSE. The benchmark FTS models selected for comparison are exponentially weighted FTS (Sadaei et al. 2014), improved weighted FTS (Efendi et al. 2013), conventional FTS (Chen 1996), trend-weighted FTS (Cheng et al. 2009), and weighted FTS (Yu 2005). Moreover, mean fitness value is considered over 30 runs of each experiment to check the robustness of the model. Also, the number of intervals and inertial weight is varied in the experiment. To the best of our knowledge, there is no fixed method of selecting the number of fuzzy sets. The cognitive constant and social constant are set to 2, based on the literature. Table 2 describes the parameters setting of the proposed model. Further, Fig. 2 illustrates the graph between fitness obtained by proposed model and number of iterations. It is observed from the figure that it is decreasing but not linearly which means model is achieving better solution precision.

Table 1 Characteristics of all datasets
Table 2 Parameter setting of the proposed model
Fig. 2
figure 2

Fitness over iterations

6.1 Enrolments of Alabama University

The benchmark dataset of enrolments of Alabama University is a yearly data from 1971 to 1992. The data are divided into 2 parts: 80% training and 20% testing. In Fig. 3, graphs represent the effect of w on RMSE for different numbers of fuzzy sets on test data whereas Fig. 4 shows the varying RMSE when number of fuzzy sets are changing. The comparative results of RMSE on test data are shown in Table 3. It is observed that results from proposed model are better when number of fuzzy sets are 7. Also, variation in RMSE is very low when number of fuzzy sets are varied from proposed model as compared to existing models.

Fig. 3
figure 3

RMSE vs inertia weight (w) for different number of fuzzy sets of enrollment dataset of University of Alabama

Fig. 4
figure 4

RMSE vs number of fuzzy sets of enrollment dataset of University of Alabama

Table 3 Comparison of the RMSE of enrollment dataset of University of Alabama for different numbers of fuzzy sets

6.2 Taiwan stock exchange capitalization weighted stock index (TAIEX)

The proposed model is applied to TAIEX from year 1999 to 2004. Further, it is divided in 2 parts: 80% training and 20% testing for each year. In Figs. 5, 6, 7, 8, 9 and 10, graphs represent the effect of w on RMSE for different number of fuzzy sets on test data whereas Fig. 11 shows the varying RMSE when number of fuzzy sets are changing. Figures 5 and 6 are graphs representing the effect of w on RMSE for different number of fuzzy sets in forecasting TAIEX 1999 and TAIEX 2000. Figures 7 and 8 are graphs representing the effect of w on RMSE for different number of fuzzy sets in forecasting TAIEX 2001 and TAIEX 2002. Figures 9 and 10 are graphs representing the effect of w on RMSE for different number of fuzzy sets in forecasting TAIEX 2003 and TAIEX 2004.

Fig. 5
figure 5

RMSE vs inertia weight (w) for different number of fuzzy sets of TAIEX 1999

Fig. 6
figure 6

RMSE vs inertia weight (w) for different number of fuzzy sets of TAIEX 2000

Fig. 7
figure 7

RMSE vs inertia weight (w) for different number of fuzzy sets of TAIEX 2001

Fig. 8
figure 8

RMSE vs inertia weight (w) for different number of fuzzy sets of TAIEX 2002

Fig. 9
figure 9

RMSE vs inertia weight (w) for different number of fuzzy sets of TAIEX 2003

Fig. 10
figure 10

RMSE vs inertia weight (w) for different number of fuzzy sets of TAIEX 2004

Fig. 11
figure 11

RMSE vs number of fuzzy sets of TAIEX dataset

The comparative results of RMSE on test data for different number of fuzzy sets for TAIEX 1999 is shown in Table 4, for TAIEX 2000 is shown in Table 5, for TAIEX 2001 is shown in Table 6, for TAIEX 2002 is shown in Table 7, for TAIEX 2003 is shown in Table 8, for TAIEX 2004 is shown in Table 9. It is observed that results from proposed model are better than the existing models. Also, when number of fuzzy sets changes, there is less variation in RMSE from proposed model as compared to existing models. The comparison between the actual and forecasted data of TAIEX 1999 and TAIEX 2000 is shown in Figs. 12 and 13. The comparison between the actual and forecasted data of TAIEX 2001 and TAIEX 2002 is shown in Figs. 14 and 15.The comparison between the actual and forecasted data of TAIEX 2003 and TAIEX 2004 is shown in Figs. 16 and 17.

Table 4 Comparison of the RMSE of TAIEX 1999 test data for different numbers of fuzzy sets
Table 5 Comparison of the RMSE of TAIEX 2000 test data for different numbers of fuzzy sets
Table 6 Comparison of the RMSE of TAIEX 2001 test data for different numbers of fuzzy sets
Table 7 Comparison of the RMSE of TAIEX 2002 test data for different numbers of fuzzy sets
Table 8 Comparison of the RMSE of TAIEX 2003 test data for different numbers of fuzzy sets
Table 9 Comparison of the RMSE of TAIEX 2004 test data for different numbers of fuzzy sets
Fig. 12
figure 12

Graphical comparison between actual and forecasted data of TAIEX 1999

Fig. 13
figure 13

Graphical comparison between actual and forecasted data of TAIEX 2000

Fig. 14
figure 14

Graphical comparison between actual and forecasted data of TAIEX 2001

Fig. 15
figure 15

Graphical comparison between actual and forecasted data of TAIEX 2002

Fig. 16
figure 16

Graphical comparison between actual and forecasted data of TAIEX 2003

Fig. 17
figure 17

Graphical comparison between actual and forecasted data of TAIEX 2004

6.3 WTI crude oil prices

The dataset of Cushing, Oklahoma, U.S. is considered as the largest oil storage tank farm in the world. The amount of crude oil stored at Oklahoma, controls its price all over the world and because of that Cushing is pricing point for WTI oil prices. The data is collected from the site https://www.eia.gov/ from January 1986 to August 2019. It is divided into 2 parts: 80% training and 20% testing data. Figure 18 is the graph representing the effect of w on RMSE for different numbers of fuzzy sets on test data whereas Fig. 19 shows the varying RMSE when number of fuzzy sets are changing. The comparative results of RMSE on test data is shown in Table 10. It is observed that results from proposed model are better when number of fuzzy sets are 7 and 8. Also, variation in RMSE is less when number of fuzzy sets are varied from proposed model as compared to existing models. Figure 20 shows the comparison between the actual and forecasted data.

Fig. 18
figure 18

RMSE vs inertia weight (w) for different number of fuzzy sets of WTI crude oil prices test data

Fig. 19
figure 19

RMSE vs number of fuzzy sets of WTI crude oil prices test data

Table 10 Comparison of the RMSE of WTI crude oil price test data for different numbers of fuzzy sets
Fig. 20
figure 20

Graphical comparison between actual and forecasted data of WTI crude oil prices

7 Conclusion

This study suggests a computational fuzzy time series model that combines particle swarm optimization and dynamic order algorithm. PSO was applied to optimize the interval length. The presented study is based on a dynamic order algorithm in which the order selection of FTS is adaptive and the hassle of the defuzzification process is reduced. The advantage of the proposed method is that it is adaptive in nature, optimal length of interval is obtained by PSO and provides the forecasted value in crisp form which reduces the need of defuzzification process. The model is tested and evaluated on enrolments of University of Alabama, stock indices of the Taiwan Stock Exchange, and Cushing, WTI spot prices of crude oil. The data were divided into 2 parts: 80% for training and 20% for testing. This study investigated the effects of inertia weight and the number of fuzzy sets on RMSE. The comparison of results is done on the basis of RMSE with the existing models (Yu 2005; Cheng et al. 2009; Sadaei et al. 2014; Chen 1996; Efendi et al. 2013), and it is observed that the proposed model performs better than the existing models. Graphs show how inertia weight and the number of fuzzy sets affect the fitness of FTS models. Also, less variation was observed in the results, which shows the robustness of the model. This work can be expanded by applying deep learning models to fuzzy time series and examining the effects of their parameters on the FTS model.