Document Type : Original Article
Authors
 Moslem Nilchi ^{} ^{1}
 Daryush Farid ^{} ^{2}
 Moslem Peymany ^{3}
 Hamidreza Mirzaei ^{4}
^{1} Ph.D. Candidate in Financial Engineering, Department of Accounting and Finance, Yazd Universtity, Yazd, Iran.
^{2} Associate Prof, Department of Accounting and Finance, Yazd University, Yazd, Iran.
^{3} Assistant Prof, Department of Finance and Banking, Allameh Tabataba'i University, Tehran, Iran.
^{4} Assistant prof, Department of Accounting and Finance, Yazd University, Yazd. Iran.
Abstract
Abstract
Volatility and risk measurement are essential parameters in risk management programs that can affect economic activities and public confidence in the stock market. Also, these two are the keys in the studies that connect the stock market, economic growth, and other financial factors. In recent years, due to the instability in the Tehran Stock Exchange, controlling the adverse effects caused by the volatility of stock prices, predicting and modeling price dynamics, and measuring risk have become necessary for the participants in this market. In the present research, the class of hidden Markovian index models of conditional variance Heteroskedasticity (HMGARCH) is used to predict the volatility of stock prices and accounts of the Tehran Stock Exchange. For a comprehensive review, the models are selected to include the characteristics of volatility clustering, asymmetry in volatility (leverage effect), and heavy tail of stock returns (with tstudent distribution). Based on RMSE and AME criteria, the HMEGARCHNormal Exponential GARCH model with normal distribution is more effective than other models in predicting stock market volatility. Therefore, leverage is necessary to analyze stock market risks using hidden Markov models, but heavy tail distribution is unnecessary. The results indicate that the HMEGARCHNormal model appropriately assesses volatility and improves market transparency and risk management forecasts. Also, the VaR and CVaR market risk assessment posttests using Kupiec and DQ tests do not show evidence of overestimation or underestimation.
Keywords
Introduction
One of the main functions of the stock market is to distribute risks arising from economic activities among many people. Thus, understanding the volatility behavior of [stock] prices is important for valuing financial assets and implementing riskhedging strategies (Evgenidis, 2018). One accepted fact in the empirical research conducted in the financial and stock markets is that volatility varies over time (Bentes, 2021). Many models that model timevarying volatility have been developed in the last decade, which fall into two major groups. In group (1), there are GARCHtype models (Engel, 1982), and in group (2), there are stochastic volatility (SV) models (Taylor, 1986), Markov Switching (MS), and hidden Markov (HM). Koopman et al. (2016) introduce the group of SV and Markov models as parameterdriven models. This latter group is flexible in volatility modeling. Mayer and Yu (2000), Berg et al. (2004), and Shephard (2005) consider the strength of group (2) models in comparison with GARCHtype models to be the existence of an excess white noise process in the equation of state. In these models, volatility is a hidden variable and follows a stochastic process (Brooks & Prokopczuk, 2013) and Lin et al., 2020).
Some research in financial literature has shown that group (2) models are more favorable than GARCH models, and it is better to model volatility as a hidden random process (Yu, 2002, Hansen, Huang, and Shek, 2012; Wang et al., 20016). Considering the structural transmission of volatility during economic and financial cycles, some researchers have recommended volatilityswitching models in volatility forecasting and risk assessment and management. For example, Marcucci (2005) compared the forecasting ability of ensemble MSGARCH models with singleregime GARCH models. His findings prove that MSGARCH models are significantly superior to the models of the second group. Chang (2012) applied an MSEGARCH model to predict future prices. He found that this model can well portray the stylized facts in the financial markets. Also, Herrera et al. (2018) confirm that the MSGARCH model provides more accurate forecasts than simple GARCHtype models for predicting future price volatility. In general, regimeswitching models that incorporate the effect of structural changes in economic conditions improve the ability to model the characteristics of financial time series.
Also, Lin et al. (2020) have compared the efficiency of MS and HM volatility models in forecasting volatility in WTI crude oil prices and China Dacoin. They have shown that HM models are more effective in predicting both types of crude oil volatility.
In the literature of the financial field, less attention has been paid to parameterdriven models, especially hidden Markov models in risk management and evaluation using quantitative criteria such as Value at Risk (VaR) and Conditional Value at Risk (CVaR). Because GARCH models do not include the structural instabilities of the stock market due to regime change, it will lead to biased estimates of volatility and risk. The innovation of this paper, apart from the Bayesian estimation method, is the use of data from the financial market of Iran, which is a developing and relatively new market with the main feature that an economy is subject to heavy and multilateral and unilateral sanctions by economic powers. The characteristics of such a market have yet to be discovered, and its deeper investigation using financial econometric methods can help advance financial science.
The following structure of this research will be as follows: In the second part, a literature review will be presented; in the third part, the method of estimations will be included; in the fourth part, the empirical findings will be discussed; and in the final part, the conclusion will be presented.
Literature Review
Risk is an integral part of financial markets. In the field of risk measurement in financial literature, there are generally three common measurement methods used in research in the order of volatility, value at risk (VaR), and conditional value at risk (CVaR). Engel (2006) says, "Uncertainty can change people's behavior in macroeconomics. Although such an effect (in macroeconomics) can be real, it is not large compared to other effects. In finance, uncertainty and risk determine the main characteristics of what will happen in the future", therefore; the special task of volatility is to measure uncertainty in financial markets, and for this reason, its effect is very important, but although this measure is related to risk, it is not the same. Because risk is associated with adverse future outcomes of the market, but volatility is also associated with positive outcomes. However, those like Sharpe (1966) have used volatility as a suitable proxy variable to measure risk in the definition of Sharpe's ratio. Also, Markowitz (1952) and Tobin (1958) have defined Variance as a measure of risk. This method of measuring risk is correct when the probability distribution of returns is normal. In this case, there is no difference between risk and volatility (Poon, 2005).
The VaR measurement method, first introduced by Morgan (1994), has been developed as one of the most common approaches in financial markets to manage market risk. VaR defines the maximum losses an investor can face for a given tolerance level over a specific time. Although Basel II and III recommend VaR, financial institutions have widely adopted it.
However, in measuring risk, it should be noted that the risk depends on the properties of the stochastic process generating asset price data (heavytailed or lighttailed of the process, whether the process is peaked or not peaked, the presence or absence of jumps in the process), market type, time horizon (shortterm, mediumterm and longterm), and the macroeconomic environment (Chan & Grant, 2016).
According to the opinion of the Banking International Settlements (BIS) Committee, the VaR criterion cannot provide a good representation of rare events in the tails of the return distribution (Chen et al., 2019). Also, Artzner et al. (1999) argue that VaR does not satisfy the subcollectivity requirement and therefore is not a consistent measure of risk.
The CVaR criterion measures risk conservatively but consistently (Chen et al., 2019). Financial studies using VaR and CVaR to measure risk generally focus on declining stock prices (i.e., downside risk). Therefore, investors in the market inevitably lose when stock prices fall due to sudden negative news.
The effectiveness of VaR and CVaR methods in evaluating market risk depends on the methods of modeling and predicting volatility. Research shows parameterdriven group models perform better than GARCH group models in modeling and predicting turbulence (Hansen et al., 2012).
Lin et al. (2020) compared different types of GARCH models in predicting the risk of asset prices using 12 outofsample forecasting criteria. They concluded that the best risk prediction model for oil prices is the HMEGARCH singleregime model.
Rastgar and Hemati (2022) analyzed the sensitivity of three different methods in calculating value at risk. They conclude that estimation methods using loss function, GarchCopola methods, Extreme value theory, and dynamic conditional correlation were ranked first to third in VaR calculation, respectively.
Behzadi (2020), for modeling and measuring portfolio risk, investigates the effect of financial stylized facts in GARCH models. He concludes that when using the GARCH family, the GARCH GolstenJaganathahanRunkel model performs better than the other two methods, which shows the importance of considering leverage effects in risk modeling for stock returns in the Tehran Stock Exchange.
In an article, Farhadian et al. (2020) investigated random volatility models and MarkovGarch switching. Their conclusion shows that MSGJRGARCH models perform better than other models for calculating risk, which shows the importance of the change of state system in risk modeling.
In a research, Raei et al. (2020) evaluate the CVaR criterion using fixed variance and variable variance methods in the Iranian stock market. They conclude that to assess and manage risk with the CVaR criterion, the use of timevarying variance methods shows better performance.
Saranj and NoorAhmadi (2016) in research compare different Frein and GARCH value models in estimating VaR and CVR criteria. They conclude that based on the McNeil and Frey method and the MCS ranking test, Freinder's value methods for estimating VaR and CVaR criteria perform better than GARCH methods.
Najafi et al. (2017) investigated this issue in research on how to optimize the stock portfolio. They show that using the CVaR criterion optimizes the portfolio interval more efficiently.
Research Methodology
For the current research, the daily data of the total price index of the Tehran Stock Exchange was used in the period from September 27, 2010, to July 22, 2022. To calculate data yield, we use the logarithmic yield formula as follows:

(1) 
In the rest of this section, econometric methods are presented according to the research objectives.
Volatility modeling with ParameterDriven models and risk measurement quintile criteria
Definition of parameterdriven and observationdriven models
Different volatility modeling differences can be understood through observationdriven and parameterdriven models introduced by Cox (1981) and reviewed by Koopman et al. (2016). If is a parameter at time t and εt is a random variable observed at time t, in an observationdriven model, we will have:

(2) 
where Φ is a measurable function. In the parameterdriven model, the relationship is defined as follows:
(3) 

Where ηt is a new and specific change at time t. Also, Φ* is a measurable function. In the latter case, the model has a hidden structure that cannot generally be directly related to the observations.
In the current research, the performance of parameterdriven Volatility models  Hidden Markov models (HM) that do not have an observationoriented driven form will be investigated in evaluating and forecasting the risk of the Total price index of the Tehran stock market.
Hidden Markov model
A hidden Markov model consists of a binary stochastic process, one of which is a hidden Markov chain to express the behavior of the hidden states, and the other is a sequence of observations specified by the currently hidden states of a Markov chain (Rabiner & Juang, 1986). A hidden Markov model can be expressed as follows:
1) Probability distribution of the initial state
(4) 

2) Probability of transition between states or regimes
(5) 

3) Distribution of observations (signals) in terms of regimes
(6) 

N is the number of states shown with Zt at time t in the above relations. Therefore, a hidden Markov model is a triple of the form that satisfies the following constraints:
(7) 

GARCH class models
Symmetrical model
The general form of a GARCH model introduced by Bullersleaf (1986) is as follows:
(8)


For confirmation of the positive conditional variance, a limitation to be imposed on the coefficients of this model is: Also, the sufficient condition for the validity of the GARCH process is:
Asymmetric EGARCH model
Usually, the impact of uncertainty on investors' decisions in asset markets could be more symmetrical. In other words, investors will give more weight to the occurrence of a potential future loss than an identical potential profit when making their decisions in buying and selling assets. The facts observed in stock markets show that negative and positive return shocks do not have the same effect on volatility, which means an asymmetric effect of uncertainty on investors' decisions. This asymmetry is sometimes described as the leverage effect and other times as the risk premium effect. To choose a suitable model for measuring and evaluating volatility in Tehran Stock Exchange, it is necessary to check the existence of the leverage effect. Ignoring the leverage effect in the stock market (if any) leads to a fundamental bias in predicting future market prices (Hall & White, 1987). In this regard, generalizations such as the EGARCH model by Nelson (1991), GJRGARCH by Glosten et al. (1993), or the TGARCH model by Zakoian (1994) can be mentioned, which include the asymmetric relationship of returns and changes in variance. In this research, to investigate the existence of the leverage effect in the Tehran Stock Exchange, the EGARCH model has been used in the hidden Markov model.
This model was presented by Nelson (1991) to correct some of the weaknesses of the GARCH model. The general form of this model is as follows:
(9) 

The coefficient must be negative in the above expression if there are leverage effects. In this case, the occurrence of a negative shock equal to one unit will have an effect equal to the volatility, and if the shock is positive, the amount of this effect will be equal to .
Combination of volatility models with Markov functions of regime transition
The dynamics of asset return behavior depend on whether the variance behavior is mechanistic or evolutionary. An evolutionary model describes volatility behavior concerning variance regimes. What regime the variance is in at any point in time can be considered a random or definite matter depending on the information of the researchers. In the present research, it is assumed that it is impossible to definitively determine what regime the variance is in at any time. In such a situation, the conditional distribution can be defined as follows:
(12) 

The above relation describes the return distribution provided it is placed in regimes. In this relation, variance is defined as variable over time and dependent on regimes. It also is a parameter of the distribution shape. The state variable is a hidden variable that selects its values from a set of nonoverlapping regimes. The Zt variable is assumed to follow a firstorder homogeneous hidden Markov process (as a random model). The transition matrix of Markov states for a tworegime state is defined as follows:
(13) 

In this relation, the is the conditional probability of transition from state to state. Because these values are the probability of the occurrence of an event, it is necessary to have a limit for all . Also, Markov properties should be maintained for all .
After introducing the dynamics of return behavior and how it is related to the variable variance in time and different regimes according to Haas, Mittnik, and Paollela (2004), the conditional variance return from a GARCH regime change model provided that the Z s variable is in regime s will be defined as follows:
(12) 

In the above relations, the functional form of the variance is conditional and, depending on the specification of the GARCH model and the parameter vector of the variable regime of q, can be equal to one or two.
After the model's specification, the likelihood function is formed to estimate the parameters. Of course, because the Z t state variable is unobservable, this method's problem of estimating coefficients is highly nonstandard. If we show the vector of parameters as a set , its likelihood function will be as follows:
(13) 

Where is the probability density function of if there is a filter and the parameter vector? For the GARCH regime change model, density r t is defined as follows:
(14) 

In the above relationship is the Hamiltonian filter of the probability of state I at time t1.
The above description is volatility modeling using the Markov state change model (MSGARCH). When the S t states are considered hidden variables, their equations should be obtained using Markov's MCMC. This issue will lead to the reduction of volatility measurement error. The present study estimates the density function using the Bayesian approach and the MCMC algorithm. For this purpose, based on the Bayesian rule, it is necessary to use the prior probability density function in combination with the likelihood function of relation (13) to obtain the posterior probability distribution. The functional form of the posterior probability distribution is uncertain because the prior probability distribution functions are not conjugate.[1], so it is necessary to use Gibbs or MetropolisHastings sampling algorithms for estimation.
Evaluation of models based on outofsample forecasting
The outofsample prediction error calculation criteria of root mean square error (RMSE) and mean absolute error (MAE) have been used to choose the appropriate model for predicting volatility and risk. To make the comparison between the models more appropriate, forecasting a future period for different tworegime HMGARCH models that include both asymmetric effects in the form of the EGARCH model and heavytailed marginal distribution of the ttype is examined. As expected, we will use the model in which the criteria obtained the lowest amount for predicting volatility and assessing risk.
The risk backtests
To evaluate the back test of VaRs accuracy, it is necessary to calculate the empirical failure rate of the estimates. The failure rate calculates the ratio of times returns exceed the estimated VaRs to the total number of observations. If the calculated ratio is equal to the predetermined VaR level (i.e., α=1% and α=5%), the model is said to be correctly specified. If the failure rate is higher than the desired quantile, it can be concluded that the model underestimates the risk.
The Failure rate for the downside risk of a long trading position (denoted by FRVaRs) is calculated as the percentage of negative returns smaller than the lefthand quantile. Also, the failure rate for the upside risk of a short trading position (denoted by FRVaRd) is defined as the ratio of returns more significant than the righthand quantile of VaR. FRVaRs and FRVaRd are defined as follows:
(15) 
, , 
In this relation, and are estimated values for downside and upside risk at time t for a given confidence interval. Also, T is the number of observations and is the indicator function, which is defined as follows:
(16)) 

Several formal tests are based on the above criteria for backtesting VaR estimates. In the present study, the unconditional coverage test (LRuc), proposed by Kupice (1995), and the dynamic quantile test (DQ) introduced by Engel and Manganelli (2004) are used. Both tests examine the null hypothesis H0 ∶F R=α. Good VaR model performance should be accompanied by unconditional exact coverage, i.e., statistically expected failure rate to equal the prescribed significance level.
In the following, a number of the most recent researches that have dealt with volatility modeling and risk assessment with VaR and CVaR criteria in different markets using HMGARCH models have been introduced.
Data Analyses
graph (1) shows the empirical distribution of total price index data. Graph (1) shows that the return behavior of the total index of the Tehran Stock Exchange is almost symmetrical (around the average). In the case of substantial returns (negative or positive), it is almost similar to other financial markets. As indicated by arrows A and B, the substantial and very negative return values shown in the tails of the distribution occur in this market more than would be expected from a normal variable. This stretch above the tails can be seen as a sign of different variance regimes.
In general, the dispersion of stock market returns shows that the risk and danger in this market are not uniformly distributed, but it shows themselves densely in limited (sequential) events. This distribution of return data shows that the stock market is heavily influenced by unpredictable human events.
figure 1. Empirical distribution of total index return data
Analysis of historical stock market data in a box plot (graph (2)) shows that the number of outliers (beyond the branches of the box plot) is much higher than expected from a normally distributed variable.
figure 2. Box plot of yield data and outliers in sample data
Table (2) shows the skewness coefficient of the price return data and the central and dispersion indices. This coefficient measures the relative frequency of occurrence of large returns in a specific direction (right or left). One of the realities of the Tehran stock market is that this market has experienced negative and positive values of large or limited returns almost equally (with a slight deviation towards large positive values of returns because the skewness coefficient of these data is positive but less than 0.5 (The value of this coefficient is 0.1768) this deviation cannot be considered very important). Such a behavior of the return distribution in the stock market is expected according to the utility theory. Because it means that the investor in this market prefers a slight chance of getting a significant return to a big chance of getting a small return; nevertheless, due to the almost insignificant importance of this coefficient in the stock market, traces of the irrational behavior of market participants can be guessed.
Table 2. Descriptive statistics of Tehran Stock Exchange price returns
Standard deviation 
Minimum 
Maximum 
Mean 
1.0872 
5.6702 
4.3788 
0.1516 
Normal probability value 
JarqueBera statistic 
Kurtosis 
Skewness 
0.000 
1014.98 
5.8957 
0.1644 
Inferential data analysis
Table (3) shows the evaluation results of tworegime symmetric (HMGARCH) and asymmetric (HMEGARCH) hidden Markov volatility models in light of the marginal distribution of returns in each regime using RMSE and MAE criteria.
Table 3. Efficiency of different hidden Markov volatility models based onThe measure of root mean square error RMSE
model 
NormalNormal 
Normalt 
tt 
EGARCHEGARCH 
5.491 
5.965 
5.631 
EGARCHGARCH 
5.612 
5.883 
4.603 
GARCHGARCH 
5.987 
6.262 
5.977 
(b) MAE mean absolute error
EGARCHEGARCH 
5.522 
5.910 
5.593 
EGARCHGARCH 
5.628 
5.838 
4.598 
GARCHGARCH 
5.999 
6.231 
5.972 
Based on the results presented in Table (3), the HMEGARCH model with normal distribution in both regimes has the lowest error rate based on RMSE and AME criteria. Therefore, based on this result, this model will be the most suitable for predicting future risks.
After selecting the appropriate model for predicting risk and volatility, the parameters of the selected HMEGARCHNormal models were estimated for the return of the total index of the Tehran Stock Exchange, and the results are reported in Table (4). These results show that the volatility in the return of the total index contains two regimes characterized by regime one and regime two. According to the findings in Table (4), the unconditional volatility (indicated by Uncon Vol) is higher in regime 2. Therefore, the severe volatility regime will be regime two, and the mild volatility regime will be regime one.
In the Tehran stock market, the leverage effect is confirmed in both regimes. Based on these results, the effect of a negative shock on Tehran's stock market volatility will be 0.732 in regime 1 and 0.1683 in regime 2. Therefore, negative shocks in a mild regime will have a stronger effect on volatility. The coefficient shows the stability of volatility waves in both regimes. According to the results, the stability of volatility waves in regime 1 is equal to 0.237, and in regime two is equal to 0.941. As a result, in the Tehran Stock Exchange, volatility stability is more in the volatility regime.
Table 4. Estimation of regime models for stock returns
Parameter 
HMEGARCHNormal 

Regime 1 
Regime 2 


8.841 (1.595) 
0.512 (0.118) 

0.710 (0.101) 
0.213 (0.041) 

0.317 (0.077) 
0.0127 (0.011) 

0.237 (0.135) 
0.941 (0.013) 

0.951 
0.0486 

0.021 
0.978 
Union Vol 
0.053 
0.207 
The results of probability distribution between the states in Table (4) show that in Tehran Stock Exchange, the probability of transferring volatility from regime 1 to regime 2 equals 0.0486, and the probability of transferring from regime 2 to regime 1 is also about 0.021. This situation shows that the transition of the market to calm and volatile conditions depend on rare events and completely random events such as sanctions.
Graph (3) shows the probability of the working days of the Tehran Stock Exchange being in the high volatility regime or regime (2).
figure 3. The smoothed probability of the market working days being in a highly volatile regime
Based on the findings presented in this graph, almost all the days after 20198 until the beginning of August 2022, with a probability of more than 0.8, are in regime (2) or severe volatile regimes. This finding follows graph (4), which shows the yield volatility in the time interval from the first working day of 2019 to August 1, 2022.
figure 4. volatile waves corresponding to the volatile regime or regime (2)
Table (5) shows the volatility prediction of the total index of the Tehran Stock Exchange based on HMEGARCH_ Normal models for the first ten days of August 2022. Based on the results presented in Table (5), it is expected that the volatility in the stock exchange will gradually increase and reach the highest level in predicted days on the eighth day.
Table 5. Tehran Stock Exchange in ten working days of August 2022 Volatility Forecasting
Forecast of index volatility 

0.0082 
First day 
0.0095 
Second day 
0.0088 
Third day 
0.0090 
Fourth day 
0.0089 
Fifth day 
0.0091 
Sixth day 
0.0099 
seventh day 
0.0104 
Eighth day 
0.0093 
ninth day 
0.0097 
Tenth day 
VaR and CVaR calculation results
After choosing the appropriate model among the HMGARCH models for predicting volatility, It is used to predict Value at Risk (VaR) and Conditional Value at Risk (CVaR). In the current research, based on the selected HMEGARCH_ Normal model, the VaR and CVaR criteria have been calculated depending on the occurrence of severe volatility (regime 2) or mild volatility (regime 1) for the ten days of the beginning of August 2022 in the quantile of 5%.
Table 6. Calculation of market risk in the Tehran Stock Exchange
CVaR 
VaR 


Regime 2 
Regime 1 
Regime 2 
Regime 1 

0.147 
0.147 
0.401 
0.115 
First day 
0.148 
0.148 
1.329 
0.117 
second day 
0.158 
0.158 
1.971 
0.128 
Third day 
0.174 
0.174 
1.882 
0.122 
Forth day 
0.156 
0.156 
2.244 
0.117 
Fifth day 
0.165 
0.165 
2.197 
0.115 
Sixth day 
0.174 
0.174 
1.981 
0.115 
seventh day 
0.172 
0.172 
1.738 
0.130 
Eight day 
0.191 
0.191 
2.201 
0.131 
Ninth day 
0.190 
0.190 
2.395 
0.136 
Tenth day 
Based on the findings presented in Table (6), in the case of a mild volatility regime (regime 1) in the Tehran Stock Exchange based on the VaR criterion, the highest expected loss (equal to 0.136 per monetary unit invested in this market) with the probability occurrence of 5% is related to the tenth day and the lowest loss (equal to 0.115 per monetary unit invested in this market) will be related to the first, sixth and seventh days. However, in case of the realization of the extreme volatility regime (regime 2), the maximum loss in the time frame of this study's forecasts (equal to 2.395 per currency unit of investment) is expected to occur on the tenth day, and the lowest expected loss will occur on the first day of trading. The risk assessment in Tehran Stock Exchange using the CVaR criterion is similar in terms of the time of occurrence of the maximum and minimum losses in the case of regime 1. However, in the case of regime 2, the maximum loss is predicted to occur in the fifth month and the minimum in the first month of the year.
Kupiec and DQ backtests
Table (7) shows the results of Kupiec's test for the HMEGARCHNormal model.
Table 7. Kupiec test
(a) Short position 

Probability value 
Kupiec's likelihood ratio 
Success rate 


0.164 
1.929 
0.944 
5% 

0.090 
2.864 
0.992 
1% 

(b) Long position 

Probability value 
Kupiec's likelihood ratio 
Success rate 


0.631 
0.230 
0.048 
5% 

0.382 
0.761 
0.008 
1% 

The results of the Kupiec test for the HMEGARCHNormal model show that the hypothesis H0 ∶F R=α is not rejected. As a result, it can be said that the model correctly calculates the value at risk of the Tehran Stock Exchange market. The method presented by Kupiec (1995) can test for over or underestimation of a VaR model. However, it does not consider whether the exceptions are scattered or occur in clusters. In other words, the Kupiec approach to the VaR backtest ignores the autocorrelation in the tails of the return distribution and the VaR values. Engel and Manganelli's (2004) test has been used in the current research to overcome this weakness. This test is known as the dynamic quantile (DQ) test. As Table (8) shows, the estimated VaR values in the 5% and 1% quantiles, neither in the downward (short position) nor in the ascending (long position) state, do not reject the null hypothesis (H0 ∶F R=α). As a result, we can accept the efficiency of the HMEGARCHNormal method in risk estimation.
Table 8. DQ test
Short position 

Probability value 
statistics 

0.2867 
7.3842 
5% 
0.2782 
7.4856 
1% 
Long position 

Probability value 
statistics 

0.1978 
8.5919 
5% 
0.9231 
1.9626 
1% 
Discussion and Conclusion
The results of this research show that to accurately assess risk in the Tehran Stock Exchange and control its negative consequences, the structure of volatility assessment models should be modified in such a way that the changes in the dynamics of developments in this market include the result of events such as business cycles (which determined with known phases/regimes as stagnation, crisis, improvement, and expansion) and political (such as the agreement or nonagreement of the JCPOA). Ignoring nonlinear developments in the volatility dynamics of the Tehran stock market will lead to an incorrect assessment of the expected loss in this market. Also, this finding is significant in risk management programs. Because reliable forecasts of stock price volatility are an important input for monetary and financial authorities whose task is to stabilize growth and promote productivity growth. Also, the results showed that the marginal normal distribution is sufficient in describing the volatility developments of the Tehran stock market.
In addition, this research showed that in the framework of hidden Markov models, the most suitable model for predicting the return and volatility of the Tehran market is the asymmetric EGARCH model with normal distribution. This issue precisely indicates that adding heavy tail distributions such as t distribution instead of normal distribution will not increase the efficiency of random volatility models in predicting the future return and volatility of the Tehran Stock Exchange. Also, adding the leverage effect from the EGARCH model to the HM model significantly improves the outofsample prediction efficiency of the Tehran Stock Exchange volatility. Considering that the data of this study covered from the second month of 1986 to the end of 2021 (a relatively longtime trend), the change of stock market dynamics according to the political cycles in Iran is an expected issue and HM models because this change by considering the dynamics over time by regularizing the volatility changes can reflect this characteristic of crude oil time series data.
Future research can achieve newer results by developing the models of this research. For example, future research can extend the HN model with different GARCH models for each regime (for example, the HMEGARCHGARCH model that uses the EGARCH model for regime one and the GARCH model for regime 2). Also, methods such as the Bayesian factor and other criteria can be used to evaluate different HM models. Although these generalizations have many computational difficulties, they are an interesting area for future research.
Declaration of Conflicting Interests
The authors declared no potential conflicts of interest concerning the research, authorship and, or publication of this article.
Funding
The authors received no financial support for the research, authorship and, or publication of this article.
[1]  The conjugate prior probability distribution function is the prior distribution that produces the posterior distribution function of its cognate parameters. These types of priors reduce the computational complexity of the moments of the posterior distribution of the parameters.