Novel grey wolf optimizer based parameters selection for GARCH and ARIMA models for stock price prediction

Stock price data often exhibit nonlinear patterns and dynamics in nature. The parameter selection in generalized autoregressive conditional heteroskedasticity (GARCH) and autoregressive integrated moving average (ARIMA) models is challenging due to stock price volatility. Most studies examined the manual method for parameter selection in GARCH and ARIMA models. These procedures are time-consuming and based on trial and error. To overcome this, we considered a GWO method for finding the optimal parameters in GARCH and ARIMA models. The motivation behind considering the grey wolf optimizer (GWO) is one of the popular methods for parameter optimization. The novel GWO-based parameters selection approach for GARCH and ARIMA models aims to improve stock price prediction accuracy by optimizing the parameters of ARIMA and GARCH models. The hierarchical structure of GWO comprises four distinct categories: alpha (α), beta (β), delta (δ) and omega (ω). The predatory conduct of wolves primarily encompasses the act of pursuing and closing in on the prey, tracing the movements of the prey, and ultimately launching an attack on the prey. In the proposed context, attacking prey is a selection of the best parameters for GARCH and ARIMA models. The GWO algorithm iteratively updates the positions of wolves to provide potential solutions in the search space in GARCH and ARIMA models. The proposed model is evaluated using root mean squared error (RMSE), mean squared error (MSE), and mean absolute error (MAE). The GWO-based parameter selection for GARCH and ARIMA improves the performance of the model by 5% to 8% compared to existing traditional GARCH and ARIMA models.


INTRODUCTION
The prediction of stock prices has always been challenging due to the dynamic and complex nature of financial markets (Kehinde, Chan & Chung, 2023;Sheth & Shah, 2023).aims to improve stock price predictions' accuracy by eliminating the need for human intervention in the parameter selection process.
The primary work of this paper is as follows: • Grey wolf optimizer is considered to select the best parameters in ARIMA and GARCH models.
• GWO-ARIMA and GWO-GARCH method is used to predict the stock prices.
The Literature reviews section discusses the literature reviews, and the methodology is discussed in the Methodology section.Results analysis presented in the Results analysis section and the Conclusions section concludes the proposed work.Fang, Lee & Su (2020) presented the generalized information criteria (GIC) method to ascertain the tuning parameter.It helps select the best model for a given dataset by balancing the goodness of fit and the model's complexity.The GIC comprises two distinct components.The first component measures data compliance, while the second measures model intricacy.The study suggests that GIC operates on a trade-off basis between the accuracy of the model's fit and its level of complexity.Joyo & Lefen (2019) study explores Pakistan's equities markets' interrelationships and portfolio diversification with its partners, including China and the US.The study examined Pakistan's and its trading partners' stock market correlation and volatility using the dynamic conditional covariance (DCC) technique.Sun & Yu (2020) discussed support vector regression (SVR) and GARCH models to forecast volatility in the stock.As an alternative to the SVR-GARCH method, this GARCH-SVR method is proposed, which uses the SVR estimation technique to estimate the GARCH parameters in place of the maximum likelihood estimation.Asymmetric volatility effects are not able to be captured in GARCH-SVR models.The study considered S&P 500 index data.

LITERATURE REVIEWS
Zolfaghari & Gholami (2021) considered GARCH and ARIMA models for stock price forecasting.First, estimate the ARMA (p, q) model and residual diagnostic tests.Second, using the autocorrelation (AC) and partial autocorrelation (PAC) functions, vary ''p'' and ''q'' values from 0 to 6 and find the best-fitted model using the BIC.Third, GARCH family model-based conditional variance estimation.
Kumar Chandar (2021) presented Elman neural network (ENN)-based stock price prediction.ENN parameter settings are usually determined via trial and error.This study optimizes ENN parameters with grey wolf optimization GWO.Later, optimized parameters were given into ENN for stock price prediction.Sivaram et al. (2020) considered optimal least square support vector machine (OLS-SVM) to estimate Blockchain financial product return rates.GWO and differential evolution (DE) methods were used to finetune the parameters.Combining the GWO and DE methods helps reduce GWO's local optima and increases population diversity.The experimental results were analyzed using MSE and MAPE.Chun et al. (2021) developed a stock forecasting model by considering investor emotions.Microblogging counts the frequency of emotional terms and documents the frequency captured.Adjectives, nouns, adverbs, and interjections are extracted using POS tagging from micro-blogging data.The retrieved POS is classified using emotions such as joy and sadness.
Few studies have demonstrated that Elman neural network (ENN) is well-suited for financial market forecasting because of its feedback link, local structure, and greater capacity to handle dynamic input (Kumar Chandar, 2021).ENN is built on the backpropagation feed forward neural network (BPNN).Due to using the BP algorithm for weight optimization, ENN suffers from certain drawbacks, such as local minima and delayed convergence.The related work is shown in Table 1.
Several statistical domains have recently seen soft computing techniques like ANN and fuzzy logic for financial market prediction (Chun et al., 2021).Financial market forecasting is an important area of study.Atsalakis & Valavanis (2009) found that different ANN models predict the stock market.Because of its inherent non-linearity, self-study, selfadaptation, related memory, and self-organization, artificial neural networks (ANN) have successfully predicted stock market data.ANN can learn from input samples and extract hidden information if the functional relationships are challenging to identify patterns.
Most of the studies considered GARCH and ARIMA models for stock price prediction.The manual method has been considered for parameter selection in GARCH and ARIMA models in literature work.These methods are trial and error as well as time-consuming.To overcome this, we have considered a GWO approach for selecting the best parameters in GARCH and ARIMA models.GWO's population-based search method simultaneously searches various search spaces to improve the effectiveness of solutions.

METHODOLOGY
Stock data are collected from the National Stock Exchange (NSE), India.Axis Bank, HFDC Bank, Infosys, TCS, SBIN, and Adani stock are considered for experimental work.The dataset encompasses a significant period, including 2008 and 2023.The stock data contains four variables: open price, high price, low price, and close price.
In this work, we have identified the volatility in the stock price.Volatility helps traders and investors evaluate stock risk (Laurent & Shi, 2020).Price volatility increases returns and losses to traders.In addition, volatility may affect trading approaches and investing choices.Investors focus on volatility trading to capitalize on market fluctuations by buying low and selling high.Therefore, understanding volatility is essential for risk management and investing.Historical price data is used to calculate volatility using standard deviation.The standard deviation of the logarithmic returns of stock prices over a given period is computed.A more minor standard deviation indicates low volatility, while a larger one implies high volatility.The stock price and its volatility are described in Figs. 1 and 2.
To identify cluster volatility, the proposed work considered GARCH and ARIMA models.The ARIMA model can analyze and predict time series data.It analyses data patterns using autoregressive (AR), differencing (I), and moving average (MA) components.The Work considered GARCH(1,1) parameter estimation.

DCC-GARCH Volatility estimation
This approach measures volatility and correlation at every time, which helps identify shock news.
It increases the computational complexity when dealing with a sizeable highfrequency dataset.

GARCH-SVR S&P 500 stock returns prediction
The SVR-GARC model performs well with and without financial crises.
Due the integration of the two models, it creates complexity in model selection and parameter tuning.

Stock index prediction
In-sample findings showed that the ARIMA-GARCH model fitted well for stock index prediction.
It can be computationally expensive and require different optimization approaches to estimate the parameters of both components.

Stock price prediction
Experimental and statistical results show that the GWO method outperformed the traditional method.
The performance of the GWO method is sensitive to the selection of parameters.In the proposed work, we found a high variance in volatility clustering.Therefore, we considered the GARCH model.The GARCH model accounts for financial data's timevarying volatility.It captures conditional heteroskedasticity, where variance changes with past observations.The autoregressive (AR) and moving average (MA) terms on squared residuals make up the GARCH model.However, in GARCH and ARIMA models, parameter selection is carried out using trial and error, and it is a challenging and time-consuming task.Therefore, the proposed work considered the GWO method for parameter selection in ARIMA and GARCH models.
The GWO is an optimization algorithm inspired by nature and designed to behave like grey wolves regarding their social structure and hunting behavior (Rezaei, Bozorg-Haddad & Chu, 2018;Mirjalili, Mirjalili & Lewis, 2014).It is a population-based metaheuristic method that has shown effectiveness in solving various optimization problems, including medical diagnosis and classification.The hierarchical structure of grey wolves' social organization comprises four distinct categories: alpha (α), beta (β), delta (δ), and omega (ω).The predatory conduct of wolves primarily encompasses the act of pursuing and closing in on the prey, tracing the movements of the prey, and ultimately launching an attack on the prey.In the proposed, attacking prey is a selection of the best parameters for GARCH and ARIMA models.The overall workflow is described in Fig. 3.

GWO method for parameter selection in ARIMA and GARCH model
In the GWO method, the population of candidate solutions is represented by a pack of ''wolves'', which communicate with one another and adjust their locations based on the actions of the pack's alpha, beta, and delta wolves.In this article, the fitness levels of the wolves are used to classify them as alpha, beta, or delta.The wolf with the highest fitness is chosen as the alpha wolf, the second-best wolf is the beta wolf, and the third-best wolf is the delta wolf.These wolves are essential because they help direct the search and shape the updates the other wolves receive.MSE and RMSE metric is considered to calculate the fitness value.The proposed work GWO-based parameter selection for ARIMA and GARCH model steps are described in Algorithm 1.The selection of parameters for ARIMA and GARCH using GWO is as follows.The first is to initialize the population of wolves with random positions using random numbers.Each wolf represents a candidate solution, and the aim is to identify the optimal solution.In the second step, define the initial value for a = 2 and encircle the prey.The third is to evaluate each wolf's fitness by applying the RMSE and MSE metrics to its corresponding position.The fitness represents the quality of the solution.The fourth is to identify the wolves with the first-highest, second-highest, and third-highest wolves using the fitness values of wolves.The fifth is to update the positions of the remaining wolves.The sixth is to select the best solution by taking the average of three wolves.The positions are adjusted to explore the solution space and converge toward better solutions.
In this expression, t represents the current iteration, − → A and − → C are coefficient vectors, − → G p is the prey's position vector, − → G shows the grey wolf's position vector.The variable ''D'' represents the distance between the grey wolf and its prey, and it is defined in Eqs. ( 1) and (2).Iteratively reducing the number of components in − → a from 2 to 0 while generating random − → r1 and − → r2 in the interval [0, 1] and it is defined in Eqs. ( 3) and (4).The population of grey wolves Gi (i = 1,2,. . .,n) is created in a random manner.2: Assign the initial value of the variable "a" as 2 using

− →
Compute the fitness level of every individual within the population using RMSE, MSE, and MAE metrics for below wolves.

− → Dδ
4: Identify the wolves with the highest, second-highest, and third-highest fitness values, respectively, as the alpha, beta, and delta wolves.
5: For the range of values of t from 1 to the maximum number of iterations, update the parameters: Select the best solution by taking the average of 3 wolves.
Where r1 and r2 are random variables between zero and one, and a convergence factor falls from two to zero as n iterations increase.The alpha, beta, and delta wolves direct the omega wolves in their pursuit of the prey, and the omega wolves recalculate the prey's location based on the best estimates of the alpha, beta, and delta wolves.The pack of grey wolves is positioned as shown by Eqs. ( 5) to (11).

− →
During each iteration, omega wolves adjust their positions based on the positions of alpha, beta, and delta wolves, as these wolves possess superior knowledge regarding the potential location of prey.

RESULTS ANALYSIS
For GWO-based parameter selection for GARCH and ARIMA models in stock price prediction for experimental work, consider Indian stock market data.The datasets include stock from indices such as Nifty and Bank Nifty and consider individual stock price data like Axis Bank, HFDC Bank, etc.The dataset encompasses a significant period, including 2008 and 2023.
The grey wolf optimizer algorithm is implemented using the R code.This algorithm aims to find the best order of parameter selection in ARIMA and GARCH models.Therefore, the GWO method is integrated into the parameter selection process for the GARCH and ARIMA models.To minimize the error in the forecasting model, we have incorporated the GWO method to find the best possible values for the parameters.The GWO method requires proper tuning, considering population size, the maximum number of iterations, and the search range.For experimental work, we have fine-tuned the GWO parameters, namely population size, alpha (α), beta (β), delta (δ), and omega (ω).The detailed range values of GWO parameters are described in Table 2.For the proposed work experiment, we considered a population size of 20 and a maximum iteration of 500.Best search space parameters using the based method for HDFC Bank, SBIN Bank, Adani stock, and Infosys stock are described in Figs. 4,5,6 and 7. HDFC Bank's search space value is 4.75 for 50 iterations, and after that, its convergence.SBIN Bank search space value is 26.29 for 50 iterations; after that, it convergence.Adani stock search space value is 12.16 for 50 iterations, and after that, its convergence.Infosys stock search space value is 13.92 for 50 iterations, and after that, its convergence.These are the best search space parameters for the above stock using the GWO method.To validate the stock price prediction for the  12), ( 13) and ( 14).The GWO-GARCH model performs better than the GWO-ARIMA, ARIMA, and GARCH models.

CONCLUSIONS
This work proposed a novel approach for predicting stock prices using the grey wolf optimizer (GWO) method to select parameters in GARCH and ARIMA models.The parameter selection in GARCH and ARIMA models is challenging due to stock price volatility.The study aimed to enhance prediction accuracy by effectively determining the optimal parameters for these models.The results reported in the research demonstrated the efficacy of the GWO algorithm in choosing appropriate GARCH and ARIMA model parameters.The prediction accuracy was significantly increased using the proposed method compared to the conventional methods that use arbitrary or human parameter selection.Combining the GWO-GARCH models improves the prediction model's accuracy