# Prediction of trending topics using ANFIS and deterministic models

René Escalante, Marco Odehnal

<figure><img src="image_1.png" /></figure>

## To cite this version:

René Escalante, Marco Odehnal. Prediction of trending topics using ANFIS and deterministic models. Bull. Comput. Appl. Math., 2021, 9 (2), pp.23-42. hal-03566934

HAL Id: hal-03566934

https://hal.science/hal-03566934

Submitted on 11 Feb 2022

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_2.png" /></figure>
# Prediction of trending topics using ANFIS and deterministic models

René Escalante <fnref n="1" /> <fnref n="2" />, Marco Odehnal <fnref n="3" />

CompAMa Vol.9, No.2, pp.23-42, 2021 - Received May 5, 2021 - Accepted September 15, 2021

Special Issue II JEM 2020, Eds. Carmen Judith Vanegas and Saúl Buitrago Boret

## Abstract

Trending topics are often the result of the spreading of information between users of social networks. These special topics can be regarded as rumors. The spreading of a rumor is often studied with the same techniques as in epidemics spreading. It is common that many datasets may not have enough measured variables, so we propose a method for studying the general behavior of the spreaders by selecting estimated variables given by the deterministic model. In order to provide a good approximation, we implemented an adaptive neuro-fuzzy inference system (ANFIS). So, in our numerical experimentations, a deterministic approach using *SIR* and *SIRS* models (with delay) for two different topics is used. Thus, the authors just applied the ANFIS model for their application and the deterministic model as the preprocessing input variable.

**Keywords:** Fuzzy logic; ANFIS; rumor propagation; epidemiology; deterministic models; trending topics.

## Resumen

La tendencia de tópicos suele ser el resultado de la difusión de información entre los usuarios de las redes sociales. Estos tópicos especiales pueden ser considerados como rumores. La propagación de un rumor se estudia a menudo con las mismas

<footnote n="1">¹Universidad de Alcalá, Departamento de Física y Matemáticas, Madrid, Spain (rene.escalante@uah.es). (ORCID iD: https://orcid.org/0000-0002-6816-3557).</footnote>

<footnote n="2">²Corresponding author.</footnote>

<footnote n="3">³Universidad Simón Bolívar, Departamento de Cómputo Científico y Estadística, Ap. 89000, Caracas, 1080-A, Venezuela (markodehnal@gmail.com).</footnote>
técnicas que en la propagación de epidemias. Es común que muchos conjuntos de datos no tengan suficientes variables medidas, por lo que proponemos un método para estudiar el comportamiento general de los esparcidores seleccionando las variables estimadas dadas por un modelo determinístico. A fin de proporcionar una buena aproximación, implementamos un sistema de inferencia neuro-difuso adaptativo (ANFIS). En nuestras experimentaciones numéricas, usazamos un enfoque determinístico que utiliza los modelos *SIR* y *SIRS* (con retardo) para dos diferentes situaciones. En concreto, los autores consideraron el modelo ANFIS para su aplicación y el modelo determinístico como variable de entrada a modo de preprocesamiento.

**Palabras claves:** Lógica difusa; ANFIS; propagación de rumores; epidemiología; modelos determinísticos; tendencia de tópicos.

# 1 Introduction

Each day, the social networks keep on growing very quickly and therefore, the way that people spread information has changed dramatically. But of course, this may have serious Del Vicario *et al.* proposed a mathematical model [1], where it is concluded that social network users use to spread only those rumors which are related to their favorite category (which could be, for example, science or conspiracy theories). This behavior is reinforced when the users make contact with specialized communities in these topics, which may frequently lead them into situations of disinformation [1].

The spreading of a rumor exhibits quite similar dynamics to epidemics spreading and thus, epidemics-based techniques have been used. Many authors have researched following this line of work (see, for example, [2], [3], [4], and [5]). Thus, for instance, according to [4], a rumor can be seen as an "infection of the mind".

In the compartmental models, the population is divided in three classes: the **ignorants** (*S*), who do not know the rumor, the **spreaders** (*I*), who are currently spreading the rumor and, finally, the **stifflers** (*R*), who even though they know the rumor, do not spread it. These three categories correspond to their epidemiologically equivalent **Susceptible** (*S*), **Infectious** (*I*), and **Recovered** (*R*), respectively. The compartment models are one of the best known deterministic models. The *SI*, *SIR*, *SIS* or *SIRS* models are examples of compartment models [6] (The population is assigned to compartments with labels: *S*, *I*, or *R*, in such a way that the order of the labels
usually shows the flow patterns between the compartments.]

The standard propagation rumor model was introduced in 1965 by Daley and Kendall [2]. Also, the modeling of rumor propagation has been proposed by other authors such as Rapoport (1948) and Bartholomew (1967) (see [7] and references therein), and Zanette (2001) [8]. These models are based on stochastic processes. However, in this paper we propose a different approach.

In this work, we developed a mathematical model that provides a good fitting for the general behavior of the spreaders, using deterministic models and an adaptive neuro fuzzy inference system (ANFIS). As far as we know, fitting a rumor-spreading related dataset, using both deterministic models and ANFIS the way it is shown in this paper, has not been considered before. Additionally, we propose an original technique that allows us to fit the spreaders, and at the same time, to obtain quantitative information about unknown variables.

This paper is organized as follows. In Section 2, we review some basic concepts. In Section 3, we provide a brief description about our ANFIS approach using deterministic models, and its advantages. In Section 4 we present preliminary numerical experimentation to illustrate the proposed strategy. Finally, in Section 5 some concluding remarks are presented.

# 2 Preliminaries

## 2.1 Deterministic Models

In this paper two deterministic models are used for different situations. The first model is the well-known SIR model (differential equations-based), which was proposed by Kermack and McKendrick [9] to study epidemic diseases such as measles and rubella [10].

The SIR model is given by the following system of ordinary differential equations:

$$ \begin{cases} \frac{dS}{dt} = -\alpha SI, \\ \frac{dI}{dt} = \alpha SI - \beta I, \\ \frac{dR}{dt} = \beta I, \end{cases} \qquad (1) $$

where $\alpha$ y $\beta$ are called infection rate and recovery rate, respectively.

In addition to the distinction between diseases for which recovery confers immunity against reinfection (SIR model) and diseases for which recovered
members are susceptible to reinfection, we consider the intermediate possibility of temporary immunity described by a model of SIRS type, with constant immunity (delay differential equations-based). This model shows an endemic and unstable equilibrium point, because there is always a prevalence of the disease in the population. More complicated compartmental structure is possible. For example, there are SEIR and SEIS models, with an exposed period between being infected and becoming infective [11]. However, it makes difficult the assignment of resources for treatments [11].

The SIRS model is given by the following system of delay differential equations:

$$ 
\begin{cases}
\frac{dS}{dt} = -\alpha S(t)I(t) + \beta I(t - \omega), \\
\frac{dI}{dt} = \alpha S(t)I(t) - \beta I(t), \\
\frac{dR}{dt} = \beta I(t) - \beta I(t - \omega),
\end{cases}
\quad (2) $$

where $\alpha, \beta$ y $\omega$ are called infection rate, recovery rate and temporary immunity period length, respectively.

As it is seen in epidemics spreading, rumors can also exhibit different behaviors, such as a behavior where everybody is talking about the same topic over and over, but after some time, this attitude ends and people lose their interest about this topic very quickly. So, not everybody is the same and there will be different transmission rates of the rumor among different people (i.e., if there was heterogeneity in classes). Hence a SIR-type model can be used to study these kind of situations (see, for example, [12]). Rumors with a periodic spreading behavior also exist, these can be events that are expected to happen with a certain frequency. In this paper to model periodicity the SIRS with constant temporary immunity model is used.

## 2.2 Adaptive Neuro-Fuzzy Inference Systems (ANFIS)

Fuzzy logic has been used as a powerful tool for modeling uncertainty [13]. Here we will consider using the well-known fuzzy Takagi-Sugeno model, which arises as an effort for systematically generating linguistic rules from an input-output data [14].

In order to provide a good fitting to a dataset, a special neural network called ANFIS is used. It is functionally equivalent to a radial basis function network (RBFN) under certain conditions [15], but unlike the RBFN, ANFIS allows to do qualitative research of the data because of its close relations to fuzzy logic. ANFIS was proposed to be equivalent to the Takagi-Sugeno
model [15], so that it is possible to estimate the linguistic rules of the Takagi-Sugeno model starting from the training of an ANFIS network.

For the simplest of explanations of the layers, a two-input linear Takagi-Sugeno model is considered (see

* **Layer 1 (input layer):** a membership function is applied to the inputs. This will be the output function of the first layer:

$$O_{1,i} = \begin{cases} \mu_{\tilde{A}_i}(x) & \text{if } i = 1, 2, \\ \mu_{\tilde{B}_{i-2}}(y) & \text{if } i = 3, 4, \end{cases} \quad (3)$$

where $x$ (or $y$) are the input elements of the node $i$ and $\tilde{A}_i$ (or $\tilde{B}_{i-2}$) are membership values between 0 and 1. $O_{1,i}$ is the equivalent of a fuzzification. It can be considered as a membership function (or MF for short), for example, a generalized bell-shaped MF:

$$\mu_{\tilde{A}} = \frac{1}{1 + \left| \frac{x - c_i}{a_i} \right| 2 b_i}, \quad (4)$$

where {$a_i, b_i, c_i$} are the function's parameters known as **premise parameters**.

* **Layer 2:** every node, denoted by $\Pi$, has an output function:

$$O_{2,i} = w_i = \mu_{\tilde{A}_i}(x)\mu_{\tilde{B}_i}(y), \text{ with } i = 1, 2. \quad (5)$$

This output represents the firing strength of a rule; that is to say, the degree on which a rule is satisfied. Whenever it is closest to 1, it will be more fulfilled, however, if this value is close to 0, there will be low fulfilment.

* **Layer 3:** every node, denoted by $N$, has as output function the **normalized firing strengths** (degree of fulfillment of a fuzzy rule with maximum value 1)

$$O_{3,i} = \bar{w}_i = \frac{w_i}{w_1 + w_2}, \text{ with } i = 1, 2. \quad (6)$$

* **Layer 4:** the outputs of the fuzzy rules are weighted by the normalized firing strengths, so the output function is given by

$$O_{4,i} = \bar{w}_i f_i = \bar{w}_i (p_i x + q_i y + r_i), \quad (7)$$
where $\bar{w}_i$ is the normalized firing strength calculated in the third layer, and {$p_i, q_i, r_i$} are the parameters of this node known as **consequent parameters**.

* **Layer 5 (output layer):** the only node of this layer, denoted by $\Sigma$, computes the general output of the network:

$$O_{5,1} = \sum_{i} \bar{w}_{i} f_{i} = \frac{\sum_{i} w_{i} f_{i}}{\sum_{i} w_{i}}. \qquad (8)$$

This is not the unique setting of ANFIS, because it is possible to merge the third and fourth layers in order to obtain a four-layer network [15]. From the ANFIS architecture we note that when the values of the premise parameters are fixed, the overall output can be expressed as a linear combination of the consequent parameters. Moreover, the weight normalization can be done in the output layer [15]. This network can be trained using a hybrid learning algorithm (see [15, §8.5]): the output layer parameters are estimated using least mean squares and the rest of the network is trained using the backpropagation method [15]. Indeed, in the forward pass of the hybrid learning algorithm, node outputs go forward until layer 4 and the consequent parameters are identified by the least-square method. In the backward pass, the error signals propagate backward and the premise parameters are updated by gradient descent. The consequent parameters thus identified are optimal under the condition that the premise parameters are fixed [15, §8.5]).

For this reason, the hybrid approach converges much faster since it reduces the search space dimensions of the original pure backpropagation method. Thus we should always look for the possibility of decomposing the parameter set in the first place. For ANFIS, this can be achieved if the MF on the consequent part of each rule is replaced by a piecewise linear approximation with two consequent parameters [15, §12.3]).

## 3 Fuzzy logic approach using deterministic models

Deterministic models have been frequently used to analyze the qualitative behavior of phenomena. In general, these kinds of models are much easier to analyze than stochastic models due to their definite nature [16]. Most of these models are restricted to the assumption of constant rates [17], therefore they often fail to model important shifts that are seen in real situations (see for
example, the experiments in Sections 4.1 and 4.2). In this paper we propose the ANFIS approach using deterministic models, in order to provide a good approximation of the general behavior of the spreaders, while preserving the qualitative information that can be extracted from the deterministic models.

The strategy follows two important steps:

1. **Fitting data using a deterministic model:** a deterministic model is picked so that the error between real data and estimated data is as small as possible. This model will estimate unknown variables that should be implicit to the dataset.

2. **Training the ANFIS network:** this is carried out in two stages: first, the input variables should be chosen based on a criterion (e.g., Mallows' $C_p$). Then, the real dataset must be split into train and test data. When training ANFIS overfitting (or overlearning, which is frequently encountered in complicated adaptive systems) must be avoided by selecting right input variables, amount of MFs, and number of epochs.

In this paper we considered two rumor-related datasets, which we model using some well-known deterministic models. The first one, “Gangnam Style”, shows a similar behavior to the *SIR* spreaders curve. The second rumor, “Game of Thrones”, has a periodical behavior and therefore, we considered a *SIRS* model with delay. If a dataset is non-chaotic, it is possible to grasp the fundamental behavior of the trending topic, and then supply an adequate deterministic model for the situation.

This approach allows us to analyze the data via deterministic models and, at the same time, by using ANFIS.

# 4 Numerical Applications

We accessed Google Trends, the public web facility of Google Inc. based on Google Search engine in order to obtain weekly measured trending topics. Two trending topics were selected: “Gangnam Style” and “Game of Thrones”. The reason to use Google Trends is that the Google search engine is one of the major sources of information worldwide, regardless of the veracity of what is posted on it. The simulations and numerical results were provided by the scientific computation tool known as MATLAB, version R2013a. Fuzzy
Logic Toolbox within the framework of MATLAB was used for the training and evaluation of ANFIS. The functions used were the following: **genfis1** (Generate Fuzzy Inference System structure from data using grid partition) for generating a Sugeno-type FIS structure (used as initial conditions), which is later trained using **anfis**, and finally **evalfis**, for evaluating the experimental data set, **data**, on our trained system [18].

Populations of ignorants, spreaders and stifflers were normalized to a [0-1] scale. It is considered that spreaders are individuals who browse the internet looking for information related to the topic they are interested in.

In both experiments, each dataset was split into 50:50 for training and testing data, respectively. The division of the datasets can be seen in Figure 2(c) and Figure 4(c). The authors could also have chosen for the training and the tests any of the options 60:40 or 70:30; however, we seek that our numerical experiments have, as far as possible, a good visualization.

## 4.1 The “Gangnam Style” fever

“Gangnam Style” is a song interpreted by the South Korean musician Psy. It was released on July 15, 2012 together with a music video, which shortly became the most viewed video of Youtube. After several weeks, this popular song was not interesting anymore for the majority of the web users. As it is seen in Figure 1(b), there are two important peaks around the first 50 weeks, this is a behavior known as “chimney” [19]. “Chimneys” are composed by two “wedges”, (where population rises and falls at similar rates over time) which are separated by a level in which the population does not have a strong variation. In other words, there is a rumor outbreak but the user interest remains very high for a few weeks before dropping down. It is suggested in [19] that the majority of topics share the same patterns in both search and social media activity, so modeling this situations using a model of social behavior model would be appropriate. The *SIR* deterministic model only has one peak, therefore it is used for studying only the general behavior of this rumor and extracting useful information for predictions.

Google Trends dataset provided dates against search percents, so the only available data consisted of time and spreaders variables. A better dataset was needed to train ANFIS properly, so by applying an *SIR* model to the spreader data would create estimated curves for ignorants, stifflers and also spreaders (all time-dependent). In order to fit the *SIR* model, we needed to solve the parameters searching problem, which was solved using exhaustive
search on the $\alpha$ and $\beta$ parameters from 0.001 to 1, taking a 0.001 length step. For each value of $\alpha$ and $\beta$, Euler's method was used to solve the ODE with initial conditions $S_0 = 0.99$, $I_0 = 0.01$, $R_0 = 0$. And so, the best SIR model was chosen to minimize the LSE (Least Squares Error) of the spreaders:

$$LSE = \frac{1}{n} \sum_{i=1}^{n} (\hat{Y}_{i} - Y_{i})^{2}$$

where $\hat{Y}_i$ is the estimated value and $Y_i$ is the real value. The elapsed time of this algorithm was 0.958143 seconds, for $n = 233$. The parameters are shown in Table 1. Figure 1 shows the closest fit provided by an SIR model to this dataset.

<table><caption>Tab. 1: “Gangnam Style” SIR parameters.</caption><thead><tr><th></th><th>LSE</th><th>I<sub>0</sub></th><th>α</th><th>β</th><th>n</th></tr></thead><tbody><tr><th>Value</th><td>0.0046</td><td>0.01</td><td>0.7750</td><td>0.0380</td><td>233</td></tr></tbody></table>

<figure><img src="image_3.png" /><figcaption>Fig. 1: Class of individuals related to the trending topic “Gangnam Style”. (a) SIR model adapted to “Gangnam Style”; (b) graphical comparison between real and estimated data by the SIR model.</figcaption></figure>

Now we have three variables to select as an input: time, ignorants (SIR), and stifflers (SIR), but it is necessary to select the appropriate variables that can allow ANFIS to produce both a well trained model with good accuracy. For this task we considered Mallows' $C_p$ criterion, from which the $C_p$ statistic is defined as follows:
$$C_p = \frac{\sum_{i=1}^{n} (\hat{Y}_i - Y_i)^2}{\sigma_d^2} - n + 2p,$$

where $\sigma_d^2$ is the mean square error of the residuals for a full model using all possible input variables, $n$ is the size of the dataset, and $p$ is the number of parameters of the model [20]. ANFIS has two sets of parameters: nonlinear and linear, which are determined by the number of input variables, membership function type and amount, and the network's output, respectively. So, $p$ can be calculated using the following equation:

$$p = \begin{cases} V K \theta + K^V & \text{for constant output,} \\ V K \theta + (V + 1) K^V & \text{for linear output,} \end{cases}$$

where $V$ is the number of input variables, $K$ is the number of membership functions, and $\theta$ is the number of parameters of the membership function. The first and the second terms correspond to the number of nonlinear and linear parameters, respectively. Theoretically, the value of $C_p$ for the optimal model will be $p$ [20], therefore, in order to select the best model, we first calculated the Mallows' $C_p$. Then we computed the distance between this result and each $p$ in order to find which model's coefficient is the closest to its number of parameters.

Table 2 suggests that time and stiflers (SIR) with constant output provide the optimum model. Hence, we selected these two variables as the ANFIS inputs.

As a neural network, ANFIS also requires to be trained within a certain number of epochs. Different training epochs can affect the capability of the network to classify patterns on which they have not been trained (generalization capability); for example, an overtrained network will only produce good results with familiar data. The real data was split into a training data and a validation data. Several simulations were done using different number of training epochs for ANFIS, verifying that the check error (difference between ANFIS output and validation data) and training errors (difference between ANFIS output and training data) were close (so that ANFIS would have generalization capability). Also, we compared the generalization capabilities and LSE between linear and constant output models. Finally, the best ANFIS network for this dataset was found within 50 epochs, as it can be seen in Figure 2.
<table><caption>Tab. 2: Distance between Mallows' Cp and the corresponding number of parameters of each model. This table was considered for choosing the best ANFIS input variables for the “Gangnam Style” experiment.</caption><thead><tr><th rowspan="2">Output</th><th colspan="3">Input variables (single-input)</th></tr><tr><th>ignorants (SIR)</th><th>stifflers (SIR)</th><th>time</th></tr></thead><tbody><tr><td>constant</td><td>1.1381 × 10<sup>4</sup></td><td>118.5243</td><td>7.0423 × 10<sup>3</sup></td></tr><tr><td>linear</td><td>5.5173 × 10<sup>5</sup></td><td>778.0769</td><td>3.6166 × 10<sup>4</sup></td></tr></tbody></table>

<table><thead><tr><th rowspan="2">Output</th><th colspan="3">Input variables (double-input)</th></tr><tr><th>ignorants (SIR) +<br>stifflers (SIR)</th><th>ignorants (SIR) +<br>time</th><th>stifflers (SIR) +<br>time</th></tr></thead><tbody><tr><td>constant</td><td>65.62</td><td>3.9308 × 10<sup>3</sup></td><td>48.4960</td></tr><tr><td>linear</td><td>1.3748 × 10<sup>3</sup></td><td>3.2994 × 10<sup>3</sup></td><td>520.2115</td></tr></tbody></table>

Membership functions also play a fundamental role in Fuzzy Inference Systems modelling, and it is important that these are chosen carefully. The performance of ANFIS is very sensitive to the amount of MFs in the system, so it should be expected that complex systems with a great quantity of MFs will perform poorly because of the amount of the premise parameters that need to be estimated. MFs can have many shapes, such as triangle, trapezoidal, gaussian, generalized bell-shaped, etc. [15]. The shape of the MF can affect the accuracy of the task that is given to the ANFIS, and according to the practical results of [21] and [22], the Gaussian MF provided a higher degree of accuracy with less complexity (this MF only has two parameters). The Gaussian MF is defined as follows:

$$ \mu_{\bar{A}} = \exp(-\frac{(x - m)^2}{2\sigma^2}), $$

where m and σ represent the center and the width of the MF, respectively.

Regarding the fuzzy rules generated by ANFIS, three Gaussian MFs were selected per input variable, so that increasing the inputs to our network would not cause the number of parameters to quickly surpass the available data. The fuzzy rules are used only for computational purposes (see [14] for basic details on fuzzy inference).

Although the spreaders curve provided by the SIR model fits the most general behavior of the data (Figure 1), the ANFIS output can now fit the
<figure><img src="image_4.png" /><figcaption>Fig. 2: ANFIS “Gangnam Style” prediction curve analysis. Input variables: time and stifflers (*SIR*), constant output. (a) Comparison of training and check *LSE* for constant output, (b) comparison of real data and ANFIS output, (c) division of the dataset into training data and testing data.</figcaption></figure>
important shift that happens between the 20th and 30th week, as it is seen in Figure 2.

## 4.2 Seasons of “Game of Thrones”

Game of Thrones is a critically acclaimed television series, which has been highly anticipated throughout the years because of its great success. The Google Trends dataset shows a periodical “chimney” which happens between each season premiere and finale (see Figure 3(b)). Another interesting feature of its success is the increasing number of viewers throughout the years.

In order to obtain weekly data, Seasons 2 to 6 were considered for this study. Contrary to the “Gangnam Style” trend, the interest in this television series is not lost, instead, every year numerous people start watching this show every time a new season is premiered.

We used SIRS model with delay to fit the spreaders again, but this time fitting the parameters with exhaustive search was not convenient because of the broad amount of values that $\omega$ (i.e., the temporary immunity period length) may take. Instead, we used the MATLAB function fminsearch, which is based on the algorithm of Nelder-Mead described in [23]. We proceed to minimize the function:

$$Err(\alpha, \beta, \omega) = \|Y(t) - \hat{Y}(\alpha, \beta, \omega, t)\|_2^2 = \sum_{t=0}^{n-1} (Y(t) - \hat{Y}(\alpha, \beta, \omega, t))^2,$$

where Y is the real data, $\hat{Y}$ are the estimated spreaders by the delayed SIRS model, and n is the number of measures, such that we have a sequence of n elements: $t = 0, 1, 2, ..., n - 2, n - 1$. For each iteration of Nelder-Mead's method, DDE's are solved using the MATLAB function ddesolve [24].

Since the Nelder-Mead algorithm is a direct method, it has the important advantage that no information about the gradient is needed [25]. fminsearch does not allow to find global minima for any initial point, thus, we had to start sufficiently close to the global minimum. Finding the global minimum is equivalent to finding the best fitting SIRS model for the real data. After manually changing the initial parameters, we found that for $\alpha_0 = 0.7, \beta_0 = 0.5, \omega = 40$, we obtained the optimum parameters, shown in Table 3 in 9.527718 seconds.
In Figure 3 the fitting quality is compared to the real data. It can be seen in this figure that the spreaders provided by the *SIRS* have constant amplitude, however, the amplitude of the real data oscillations increases through time. Therefore, the fitting quality was not the best.

<table><caption>Tab. 3: Delayed *SIRS* parameters for “Game of Thrones”.</caption><thead><tr><th></th><th>LSE</th><th>I<sub>0</sub></th><th>α</th><th>β</th><th>ω</th><th>n</th></tr></thead><tbody><tr><th>Value</th><td>0.0153</td><td>0.05</td><td>0.4981</td><td>0.1475</td><td>37.1562</td><td>261</td></tr></tbody></table>

<figure><img src="image_5.png" /><figcaption>Fig. 3: Class of individuals related to “Game of Thrones”. (a) Delayed *SIRS* populations; (b) delayed *SIRS* spreaders compared to real spreaders of “Game of Thrones”.</figcaption></figure>

To provide a good general fitting for this complex curve, the estimated number of spreaders was considered as a possible input, as it is shown in Table 4, which displays the distance between Mallows' $C_p$ and the number of parameters.

Time, spreaders (*SIRS*), and stifflers (*SIRS*) were used as input variables for ANFIS. After many simulations, the best model was obtained with the outstandingly low amount of four epochs, with three Gaussian MFs (just like the “Gangnam Style” example), and constant output (see Figure 4). In this experiment, the overfitting problem appears, this is because ANFIS was trained with few data points compared to its great number of parameters [26], which will increase depending on the amount of input variables and MFs (see [27] for details). As it can be seen in Figure 4(a), the Epochs were limited to
<table><caption>Tab. 4: Distance between Mallows' Cp and the corresponding number of parameters of each model. This table was considered for choosing the best ANFIS input variables for the “Game of Thrones” experiment.</caption><thead><tr><th rowspan="2">Output</th><th colspan="4">Input variables (single-input)</th></tr><tr><th>ignorants (SIRS)</th><th>spreaders (SIRS)</th><th>stifflers (SIRS)</th><th>time</th></tr></thead><tbody><tr><td>constant</td><td>1.1512 × 10<sup>3</sup></td><td>472.2731</td><td>187.4789</td><td>1.1637 × 10<sup>3</sup></td></tr><tr><td>linear</td><td>175.5956</td><td>213.1175</td><td>185.5772</td><td>170.4134</td></tr></tbody></table>

<table><thead><tr><th rowspan="2">Output</th><th colspan="4">Input variables (double-input)</th></tr><tr><th>ignorants (SIRS) +<br>stifflers (SIRS)</th><th>ignorants (SIRS) +<br>spreaders (SIRS)</th><th>spreaders (SIRS) +<br>stifflers (SIRS)</th><th>time</th></tr></thead><tbody><tr><td>constant</td><td>268.7067</td><td>437.7463</td><td>315.8023</td><td></td></tr><tr><td>linear</td><td>196.2437</td><td>190.5610</td><td>198.7697</td><td></td></tr><tr><td></td><td>time +<br>ignorants (SIRS)</td><td>time +<br>spreaders (SIRS)</td><td>time +<br>stifflers (SIRS)</td><td></td></tr><tr><td>constant</td><td>972.5523</td><td>145.5336</td><td>721.7847</td><td></td></tr><tr><td>linear</td><td>165.4337</td><td>204.7196</td><td>179.5269</td><td></td></tr></tbody></table>

<table><thead><tr><th rowspan="2">Output</th><th colspan="4">Input variables (triple-input)</th></tr><tr><th>ignorants (SIRS) +<br>spreaders (SIRS) +<br>stifflers (SIRS)</th><th>time +<br>ignorants (SIRS) +<br>spreaders (SIRS)</th><th>time +<br>ignorants (SIRS) +<br>stifflers (SIRS)</th><th>time +<br>spreaders (SIRS) +<br>stifflers (SIRS)</th></tr></thead><tbody><tr><td>constant</td><td>298.0590</td><td>61.0377</td><td>142.8159</td><td>78.1933</td></tr><tr><td>linear</td><td>96.6029</td><td>123.2538</td><td>124.3661</td><td>123.7143</td></tr></tbody></table>

only four, because otherwise, the overfitting would have been greater. It is expected to be an evident difference between training and check error because of the lack of data found on the peaks (see Figure 4(c)). We believe that a more accurate deterministic model that fits the spreaders dataset can be found. If so, the relation between the simulations and the real data will make it easier for a much simpler network to avoid overfitting while providing an accurate model.

This result shows that fitting models for even more complex behaviors such as periodicity with nonconstant amplitude can be found, using the procedure proposed in this paper. In this case, a delayed differential equations-based model provided a good estimation of unknown variables, and with the help of fuzzy rules (generated by ANFIS) we could find an appropriate general curve for the spreaders.
<figure><img src="image_6.png" /><figcaption>Fig. 4: ANFIS “Game of Thrones” prediction curve analysis. Input variables: time, ignorants (SIRS) and spreaders (SIRS), constant output. (a) Comparison of training and check LSE for constant output, (b) comparison of real data and ANFIS output, (c) division of the dataset into training data and testing data.</figcaption></figure>
# 5 Concluding remarks

In the course of time, different techniques have been used to study the spreading of rumors. Fitting a dataset is a problem to which many approaches have been proposed [28]; in particular, the discussed use of ANFIS in this paper, broadens up the field for new investigations.

The ANFIS approach allowed us to find the best curve that explains the general behavior of each dataset, however, this network is very sensible to the number of parameters, so we selected an appropriate type and amount of MFs. Mallows $C_p$ criterion can be useful for selecting optimum prediction models.

After performing many tests and analyzing the process of fitting the trending datasets, we concluded that if a dataset does not provide enough information, it is possible to obtain implicit information by applying known mathematical models (particularly, deterministic models). Knowing these variables allowed us to fit the dataset by training the ANFIS network. This has been one of the most useful results of this work and will be the starting point for future research.

# References

[1] M. Del Vicario, A. Bessi, F. Zollo, F. Petroni, A. Scala, G. Caldarelli, H.E. Stanley, and W. Quattrociocchi. The spreading of misinformation online. *Proceedings of the National Academy of Sciences*, 113(3):554-559, January 2016. doi: 10.1073/pnas.1517441113.

[2] D.J. Daley and D.G. Kendall. Stochastic rumours. *IMA Journal of Applied Mathematics*, 1(1):42-55, 1965. doi: 10.1093/imamat/1.1.42.

[3] D.P. Maki and M. M. Thompson. *Mathematical Models and Application, With Emphasis on Social, Life, and Management Sciences*. Prentice-Hall, Englewood Cliffs, N.J., 1973. ISBN 978-0135616703.

[4] M. Nekovee, Y. Moreno, G. Bianconi, and M. Marsili. Theory of rumour spreading in complex social networks. *Physica A*, 374:457-470, 2007. doi: 10.1016/j.physa.2006.07.017.

[5] R. Escalante, , and M. Odehnal. A deterministic mathematical model
for the spread of two rumors. *Afr. Mat.*, 31:315–331, 2020. doi: 10.1007/s13370-019-00726-8.

[6] F. Brauer, C. Castillo-Chávez, E. De La Pava-Salgado, K. Barley, C.W. Castillo-Garsow, D. Chowell, B. Espinoza, P. González Parra, C.H. Suárez, and V.M. Moreno. *Modelos de la propagación de enfermedades infecciosas*. Cali, Colombia. Universidad Autónoma de Occidente, 2015. ISBN 978-958-8713-65-6.

[7] D.J. Daley and J. Gani. *Epidemic Modelling: An Introduction*. Cambridge Studies in Mathematical Biology. Cambridge University Press, Englewood Cliffs, N.J., 1999. ISBN 978-0511608834, doi: 10.1017/CBO9780511608834.

[8] D. Zanette. Critical behavior of propagation on small-world networks. *Phys Rev E*, 64(5):457–470, November 2001. Art. ID 050901, doi: 10.1103/PhysRevE.64.050901.

[9] W.O. Kermack and A.G. McKendrick. A contribution to the mathematical theory epidemics. *Proceedings of the Royal Society of London*, 115:700–721, 1927. doi: 10.1098/rspa.1927.0118.

[10] F. Brauer and C. Castillo-Chávez. *Mathematical Models in Population Biology and Epidemiology*. Springer, New York, USA, 2012. ISBN 978-1-4614-1686-9, doi: 10.1007/978-1-4614-1686-9.

[11] F. Brauer and C. Castillo-Chávez. *Mathematical Models for Communicable Diseases*. Universidad Autónoma de Occidente, Philadelphia, USA, 2013. ISBN 978-1-611972-41-2.

[12] K. Thompson, R.C. Estrada, D. Daugherty, and A. Cintrón-Arias. A deterministic approach to the spread of rumors. Technical Report BU-1642-M, University of Manchester, Cornell University, Dept. of Biological Statistics and Computational Biology, 2003.

[13] H.J. Zimmermann. *Fuzzy Set Theory and Its Applications*. Springer, 2001. ISBN 978-94-010-0646-0.

[14] S.N. Sivanandam, S. Sumathi, and S.N. Deepa. *Introduction to Fuzzy Logic using MATLAB*. Springer, 2007. ISBN 978-3-540-35781-0.
[15] J.R.S. Jang, C.T. Sun, and E. Mizutani. *Neuro-Fuzzy and Soft Computing*. Prentice Hall, 1997. ISBN 978-0132610667.

[16] A. Abraham, A.E. Hassanien, and V. Snášel. *Computational Social Network Analysis: Trends, Tools and Research Advances*. Computer Communications and Networks. Springer London, 2009. ISBN 978-1848822290, url: https://books.google.co.ve/books?id=-S1KiURSfRAC.

[17] M. Roberts, V. Andreasen, A. Lloyd, and L. Pellis. Nine challenges for deterministic epidemic models. *Epidemics*, 10:49–53, March 2015. doi: 10.1016/j.epidem.2014.09.006.

[18] MathWorks. Help Center. https://www.mathworks.com/help/fuzzy/genfis1.html. Accessed on July 12th, 2021.

[19] S. Kairam, M.R. Morris, J. Teevan, D. Liebling, and S. Dumais. Towards supporting search over trending events with social media. AAAI - Association for the Advancement of Artificial Intelligence, July 2013. https://www.microsoft.com/en-us/research/publication/towards-supporting-search-over-trending-events-with-social-media/.

[20] R. May, G. Dandy, and H. Maier. Review of input variable selection methods for artificial neural networks. In K. Suzuki, editor, *Artificial Neural Networks - Methodological Advances and Biomedical Applications*, chapter 2, pages 19–44. InTech, 2011.

[21] M. Kavitha Mayilvaganan and K.B. Naidu. Comparison of membership functions in adaptive network-based fuzzy inference system (anfis) for the prediction of groundwater level of a watershed. *Journal of Computer Applications Research and Development (JCARD)*, 1(1):35–42, April-June 2011. Corpus ID: 155094294, http://prjpublication.com/backend/file/05

[22] N. Talpur, M.N. Mohd Salleh, and K. Hussain. An investigation of membership functions on performance of anfis for solving classification problems. *IOP Conference Series: Materials Science and Engineering*, 226(012103):1–7, 2011. doi: 10.1088/1757-899X/226/1/012103.
[23] J.C. Lagarias, J.A. Reeds, M.H. Wright, and P.E. Wright. Convergence properties of the Nelder-Mead simplex method in low dimensions. *SIAM Journal of Optimization*, 9(1):112-147, 1998. doi: 10.1137/S1052623496303470.

[24] L.F. Shampine and S. Thompson. Solving ddes in MATLAB. *Applied Numerical Mathematics*, 37(4):441-458, 2001. doi: 10.1016/S0168-9274(00)00055-6.

[25] Stanford University. Lecture notes in Gradient-Free Optimization. http://adl.stanford.edu/aa222/lecture_notes_files/chapter6Gradfree.pdf. Accessed on April 30th, 2017.

[26] J.A. Anderson. *An Introduction to Neural Networks*. A Bradford book. MIT Press, 1995. ISBN 978-0262510813, https://books.google.co.ve/books?id=_ib4vPdB76gC.

[27] W. Chiang and J. Lee. *Fuzzy Logic for the Applications to Complex Systems: Proceedings of the International Joint Conference of CFSA/IFIS/SOFT '95 on Fuzzy Theory and Applications*. 1995. ISBN 978-9814548373, https://books.google.co.ve/books?id=xo3sCgAAQBAJ.

[28] K. Hornik, M. Stinchcombe, and H. White. Multilayer feedforward networks are universal approximators. *Neural Networks*, 2:359-366, 1989. doi: 10.1016/0893-6080(89)90020-8.