1 Introduction

It is quite well known that the sunspot numbers (R max) has a good relation with solar activities such as flares, so R max can be used as an indicator for this kind of sudden eruption and for prediction the forthcoming solar activity. The solar activity has a strong influence on the space weather, that makes the sun is an exciting target to observing and recording the evolution of sunspots as a good global tracer of solar activities. Either the sunspot numbers or the geomagnetic indices of the solar activity cycle can be providing the features of the forthcoming solar cycles. The methods used any of these parameters are classified as precursor methods. Vitinsky (1965) presented the prediction techniques available at that time. Hathaway et al. (1999) discussed different solar cycle prediction techniques and divided them into two categories, regression techniques and precursor techniques. The regression techniques include regressions, curve fitting and neural network. They predict the feature activity as a function of time. The precursor techniques give an estimate of the amplitude of the forthcoming cycle.

Historical records of yearly sunspot numbers in the time period (1800–2009) published in SIDC website (http://sidc.oma.be/sunspot-data) were used. It is well-known that the solar activity controls the disturbance in the space weather and the variation in the climatic parameters and most of activities on Earth. The collection of sunspot number data in Sunspot Index Data Center (SIDC) motivates the astronomers and solar physicists not only to predict the future of the solar activities, but also to reveal the nature of sunspot activity, the mechanisms of solar-terrestrial relationships, climate and weather change and so on (e.g. Zimbardo et al. 2009).

The strength of these events based on the intensity of solar cycle activity. Therefore, the earlier prediction of the solar activities will prevent us from disturbances, which can be due to the energetic particles released during the solar activities.

Different approaches were used to achieve a good forecasting for solar activity, in which the features of the preceded cycles were used to predict the behavior of the future cycles (e.g. Kane 2011; Ajabshirizadeh et al. 2011; Du 2012).

Recently, Petrovay (2012) reviewed and discussed in detail main three-prediction method groups and listed their prediction results for the cycle 24. He defined these groups as precursor, extrapolation and model based methods. The last method group uses the dynamo models in the prediction analysis. The precursor method is based on a specific solar activity parameter either sunspot number or geomagnetic index at a certain time in the prediction of maximum amplitude of the following solar cycle. In the extrapolation prediction method, the time series of solar activity indicators (e.g. sunspot numbers, aa index) are used. It based on more than one previous data points to predict the future time series of this indicator. The method group includes regression procedures, curve-fitting and neural networks.

Table 1 gives the newly published articles used the above methods for prediction of cycle 24. Kane (2010), Yoshida and Yamagishi (2010) used precursor method, while Du (2012), Du and Wang (2012), Rigozo et al. (2011) and Ajabshirizadeh et al. (2011) have applied the extrapolation method. Passos (2012) used the truncated dynamo model. According to the prediction data given in Table 1, the maximum peak of the cycle 24 has a wide range of values, it lies between 52.5 from Du (2012) and 124 (Dabas et al. 2008).

Table 1 The recent predicted maximum sunspot numbers (R max) and Peak time of solar cycle 24 by several authors

In the nineties of the twentieth century came new methods based on Artificial Intelligence (AI) to predict the solar activity. The AI methods are hybrid of Fuzzy logic, neural networks and genetic algorithms. Calvo et al. (1995) used Neural Networks for prediction of solar activity. Attia et al. (2005) used Fuzzy Logic Neural Network (FLNN) model to predict solar cycle 23. Quassim et al. (2007) applied FLNN to predict solar cycles 24 and 25 based on genetic algorithm. In this work we introduce a Neuro-Fuzzy model based on sequential forward search technique to predict cycles 24 and 25. Reconstructing Neuro-Fuzzy model is determined by selecting the appropriate number of inputs based on smallest Root Mean Square Error (RMSE). The simulation results, correlation analysis and conclusions are presented.

2 The Neuro-Fuzzy model

Figure 1 shows the basic structure of a Neuro-Fuzzy network, introduced by Lin and Lee (1991). This structure has been used by many authors and modified by Horáček (1995).The gradient search scheme was used to optimize the original structure. First let us describe the structure of the Neuro-Fuzzy model that we use in this work. The following notation is used to describe the function of the nodes in each of the five layers.

\(\mathit{net}_{i}^{L}\) :

the net input value to the ith node in layer L.

\(O_{i}^{L}\) :

the output value to the ith node in layer L.

w ij :

the link that connects the output of the jth node in layer 3 with the input to the ith node in layer 4.

Fig. 1
figure 1

Basic structure of Neuro-Fuzzy topology

2.1 The model structure

The Neuro-Fuzzy model is consists of five layers, as follows:

Layer (1): Each node of this layer transmits the input values (x 1,x 2,…,x m ) to the next layer.

$$ O_{1}^{1} = x_{1}, \ldots,O_{m}^{1} = x_{m}. $$
(1)

Layer (2): This layer is known as Fuzzy layer, because each node has a Fuzzy set. For a bell-shaped membership function, the activation input and output of this layer are:

$$ \begin{array} {l} \mathit{net}_{i}^{2} = \left\{ \begin{array} {l@{\quad }l} O_{1}^{1} &\mathrm{for}\ i = 1,2, \ldots,n_{1} \\[5pt] O_{2}^{2} &\mathrm{for}\ i = n_{1} + 1, \ldots,n_{1} + n_{2}, \end{array} \right. \\[15pt] O_{i}^{2} = \exp \biggl( - \biggl( \frac{( net_{i}^{2} - c_{i}^{2} )}{\sigma_{i}^{2}} \biggr)^{2} \biggr) \quad \mathrm{for}\ i = 1, \ldots,n_{1} + n_{2}, \end{array} $$
(2)

where the parameters c and σ are the center and width of the bell-shaped function.

Layer (3): Rule layer

A T-norm operation is used to specify the precondition matching of the Fuzzy rules. The output of the rule in this layer is determined by an AND-operation.

(3)

Layer (4): Rule weight layer

This node performs a Fuzzy OR–operation to integrate the fired rules, which have the same consequent modified by rule weights. The output of this layer is represented by:

$$ \everymath{\displaystyle} \begin{array}{l} \mathit{net}_{i}^{4} = \sum_{j = 1}^{n_{1} \times n_{2}} w_{ij} O_{i}^{3} \\[17pt] O_{i}^{4} = \min \bigl( 1,net_{i}^{4} \bigr),\quad \mathrm{for}\ i = 1,2, \ldots, n_{3}. \\ \end{array} $$
(4)

The rule weight has w values either one or zero.

Layer (5): This layer computes the output of a Fuzzy model based on the defuzzification method. The most widely used method is center of area defuzzification.

$$ \mathit{net}_{i}^{5} = \sum _{j = 1}^{n_{3}} c_{j}^{4} \sigma_{j}^{4}O_{j}^{4}, \quad \mathrm{then}\ O_{i}^{4} = \frac{\mathit{net}_{i}^{5}}{\sum_{j = 1}^{n_{3}} c_{j}^{4} \sigma_{j}^{4}}, $$
(5)

where the jth link weight in this layer is \(c_{j}^{4}\sigma_{j}^{4}\).

2.2 Appropriate inputs for the Neuro-Fuzzy model

It was much more difficult to choose the appropriate number of network inputs for the sunspots data series. In this section, reconstructing the Neuro-Fuzzy model is determined by selecting minimum numbers of variables based on the smallest Root Mean Square Error (RMSE) as described in Jang’s method (1997). For simplicity, we suppose that there are 12 inputs sunspot numbers at their timing given as following: (x(t−1), x(t−2), x(t−3), x(t−4), x(t−5), x(t−6), x(t−7), x(t−8), x(t−9), x(t−10), x(t−11) and x(t−12)) and the output to be predicted is x(t). A heuristic approach to input selection is called sequential forward search, in which each input is selected sequentially to optimize the total squared error. In sunspots data series, x(t−1) and x(t−3) are selected, because their Neuro-Fuzzy model has the smallest RMSE. Seven Gaussian fuzzy sets are chosen for each input variable.

2.3 IF THEN-rules

The antecedent part of the Fuzzy rules has Gaussian Fuzzy sets and crisp values in consequent part. The Mamdani inference algorithm is used to form the rules according to Wang and Mendel (1992):

(6)

where A j1,…,A jm are the fuzzy sets constructing the antecedent part of rules, w is the rule weight and b j is a crisp value. A set of fuzzy rules represents the Neuro-Fuzzy mechanism for adjusting the effect of certain system. Thus, the aim of Neuro-Fuzzy model is to replace a skilled human operator with a fuzzy rules-based system.

The Neuro-Fuzzy model works in the following manner. In the forward run, the input values (crisp values, fuzzy sets) are first compared with all premises of the rules (input reference fuzzy sets). The outputs of the AND-neuron are then combined with rule-weight (preference between rules) to obtain the degree of rule activation. In the last layer, these degrees are aggregated with the corresponding consequents of the rules (output reference fuzzy sets) according to the inference algorithm. The output of the Neuro-Fuzzy model can be a fuzzy set or a crisp value (after defuzzification). The optimized Neuro-Fuzzy structure is based on Backpropagation algorithm. It optimized the parameters of inputs reference fuzzy sets, rule weights and output singletons.

3 Simulation results and discussions

The preliminary results show the proposed Neuro-Fuzzy produce good results in modeling sunspot cycles. The structure of Neuro-Fuzzy model has optimized using Backpropagation algorithm. Selecting appropriate input variables to the Neuro-Fuzzy model are x(t−1) and x(t−3) based on the smallest RMSE for one epoch as shown in Fig. 2.

Fig. 2
figure 2

Appropriate input variables to the Neuro-Fuzzy model. Training (circles) and checking (asterisks) errors

Figure 3 shows the Neuro-Fuzzy model discussed in Sect. 2 with the appropriate input variables; x(t−1), x(t−3) and predicted sunspot number; x(t). Due to input variables, the Neuro-Fuzzy model complexity is decreased because decreasing number of rules. The data set of the sunspot benchmark have been divided into three sets, a training set, a testing set and a prediction set. The training set is used to fit the parameters of Neuro-Fuzzy model during the training phase based on the Backpropagation algorithm, while the testing set is to make sure the goodness of the prediction procedure. The training data set is representing the whole record (1800–1988) which represent 188 sample points, and the testing data set is the rest of the period (1988–2009) as shown in Fig. 4.

Fig. 3
figure 3

Neuro-Fuzzy model with appropriate input variables

Fig. 4
figure 4

The annual mean sunspot numbers based on Neuro-Fuzzy model (solid line), the dashed line represents the observed sunspot numbers

After training phase, the optimized Neuro-Fuzzy model prediction is tested for cycles 22 and 23 and compared with actual yearly sunspot data. Figure 4 shows the comparison between observed sunspots and Neuro-Fuzzy model prediction. In the comparison, the Neuro-Fuzzy model prediction can well follow the pattern of the sunspot data. So, the Neuro-Fuzzy model can be used to forecast the sunspot data for the coming years.

The deviation between the predicted sunspot numbers and the actual ones is given as function of time in Fig. 5, while RMSE of Neuro-Fuzzy model set is presented in Fig. 6. The trend of RMSE as a function of iteration numbers, it starts large and reaches to minimum and stabilized value at the end of training part. In order to estimate the error in the maximum peaks, we compared the predicted maximum peak values for the previous cycles 22 and 23 with their corresponding actual peak values. We selected cycles 22 and 23 only, because they lie in the testing set. The difference between the predicted and actual maximum peak values gave in percentage. We found the deviations are 7.5 % and 8 % for the cycles 22 and 23 respectively. Therefore, the prediction error of the forthcoming peak maximum is the average of the above error values (8 %).

Fig. 5
figure 5

Prediction error between observed sunspot numbers and Neuro-Fuzzy model output

Fig. 6
figure 6

Training error for Neuro-Fuzzy model

The maximum amplitude of cycles 24 and 25 will occur in the year 2013 and 2022 with peaks of 101±8 and 90.7±8, respectively as shown in Fig. 7.

Fig. 7
figure 7

Peaks of solar cycles 24 and 25

The prediction of Neuro-Fuzzy model for the maximum peak of cycle 24 is compared to recent prediction for different methods as shown in Table 1. The maximum peak of the cycle 24 has a wide range of values, it lies between 52.5 from Du (2012) and 124 (Dabas et al. 2008). Therefore we calculated the weighted mean of R max for the three method groups from data given in Petrovay (2012) to get a reliable sense to compare the predication goodness of these method groups. These weighted means of R max are 92, 118 and 167 for precursor, extrapolation and model based methods respectively. It seems that the last method gives overestimated R max values according to the trained of long cycle, the peak of sunspot numbers of the cycle 24 might lower than that of the cycle 23 by amount of 23 % (Rigozo et al. 2011).

In this work we find out that the maximum of cycle 24 and cycle 25 will occur in the year 2013 and 2022 with maximum amplitudes of 101±8 and 90.7±8 respectively. Thus, the peak of solar cycles 24 and 25 would be 16 % and 24 % lower than that of 23, our expected decay for the maximum sunspot numbers for the forthcoming cycles agrees with the finding given by Rigozo et al. 2011. They found that the peaks of cycles 24 and 25 would be decreased than that of cycle 23 by amount of 23 % and 5 % respectively.

4 Correlation analysis

Correlation is a measure of the relation between two or more variables. In this case, it is the relation between the Neuro-Fuzzy model forecasted sunspot numbers value with the actual value of the sunspot numbers. Correlation coefficients can range from −1.00 to +1.00. The value of −1.00 represents a perfect negative correlation while a value of +1.00 represents a perfect positive correlation as in Hill and Lewicki (2007). A value of 0.00 represents a lack of correlation. The correlation coefficient between Neuro-Fuzzy model forecasted sunspot numbers value and the actual value of the sunspot numbers is 0.96. One of the most common ways of validating Neuro-Fuzzy model is to display the autocorrelation function of the residuals and the cross correlation function between inputs and residuals. The autocorrelation coefficients between Neuro-Fuzzy model and prediction error is shown in Fig. 8a and the cross-correlation coefficients between the prediction error and the input variables x(t−1) and x(t−3) are shown in Fig. 8b and Fig. 8c. Sample autocorrelation with 96 % confidence intervals (CI) for sunspot data, 1988–2009. Dashed lines are simple approximate confidence interval at \(2/\sqrt{N}\), where N is the sample size. The correlation coefficients almost stay within their standard deviations.

Fig. 8
figure 8

Autocorrelation and cross-correlation coefficients for prediction error and inputs/output of Neuro-Fuzzy model

5 Conclusion

The simulation results carried out in this paper shows the effectiveness of the proposed Neuro-Fuzzy model as a predictor for the forthcoming cycles 24 and 25. In this work, new method for selecting appropriate inputs for the Neuro-Fuzzy predictor based on the smallest RMSE is presented. The complexity of the proposed model is decreased due to decreasing appropriate inputs leads to decrease number of rules. Reconstructing the structure of the proposed model and prediction of sunspot number series were performed. The predicted sunspot numbers values are correlated with the actual value of the sunspot numbers with the accurate autocorrelation coefficients between prediction errors of the model output. We predicted the maximum sunspot numbers for the cycles 24 and 25 are 101±8 and 90.7±8 and it will occur at 2013 and 2022 respectively.