The Stock Prices Prediction Performance of Hidden Markov Models in the Luxury Category

: The stock market is the place where issued stocks are transferred, traded and circulated, including exchange market and over-the-counter market. Because it is based on the issuance market, it is also called the secondary market. The structure and trading activities of the stock market are more complex than the issuance market (the primary market), and its role and influence are also greater. It is precisely because of its complex systems and processes that achieving accurate predictions is very difficult and challenging. The Hidden Markov Model is not a commonly used model in predicting the next day’s stock price. Hence, I will focus on the Hidden Markov Model with four luxury giants to prove whether the HMM is suitable for that industry, and which company fitted most.

crowned the world's richest man. In other words, we could hardly neglect the effort made by these luxury companies to the world stock market which is really worth to make research.

2.Literature Review
There are hundreds of studies applying the Hidden Markov Model, and in recent years the relevant reviews have shown the accuracy and uniqueness of the HMM. When predicting the genes coding for proteins, the HMM shows the researchers with the greatest accuracy and foresight, and it has broken the stereotype [4]. Apart from predicting the internal part of human beings, the HMM is also a good tool to check the outer production of people, including speech recognition [1] and face identification [3]. In the post-pandemic period, it is also a highlighted issue which is COVID-19 detection. HMM, a cough recognition system has emerged to assess COVID-19 [6].
When it comes to finance, the Hidden Markov Model can also make a great effort to it, and several researches have been done concerning it. For instance, researchers have used both the Hidden Markov Model (HMM) and Support Vector Regression Model (SVR) to forecast the stock [5,7] The improved hidden Markov model and deep learning are used for financial information extraction [8]. Xing Gu at the University of Ontario has proved that an HMM-Driven Approach can be the early-warning alert system for financial-instability detection [2].

Hidden Markov Model
Hidden Markov Model (HMM) is a statistical model, which is used to describe a Markov process with hidden unknown parameters. The difficulty is to determine the implied parameters of the process from the observable parameters. These parameters are then used for further analysis, such as pattern recognition.

Hidden Markov Model for stock trend judgment
The hidden Markov Model is always be reckoned as one of the most powerful tools to predict nonstationary systems, including Stock Markets. At the same time, Stock Market is exhibiting the data and prices continuously, which is an essential feature fitted with the HMM. Suppose Ot is a vector of four numbers, which are daily close, open, high, and low. St is also a variable that is called the state of the day t. And other terminologies applied in the Hidden Markov Mode are listed as follows. Time

Prediction of Stock Prices
The key point of predicting the coming days' stock price is calculated observations before K logarithmic likelihood, and through the window to the past data move in the direction of the day, it is the same as before all the size of the subsequence of logarithmic likelihood is used in the comparison. Then, we determine the past one day, before its K observation log-likelihood closest to a subsequence, the sequence of the next day the price will be predicted.
We then calculate the change in the spread from the date of determination to the next day. This change is then added to the price for the day to obtain our forecast for the next day.
Subsequently, after we obtain real observations, we incorporate them into our data set and readjust our model parameters to ensure that our model does not diverge. In short, we fixed the size of the subsequence and located another subsequence from past data that showed a similar pattern. We then map the behavior of the identified subsequences to the subsequences used for prediction.
Selecting multiple hidden states for an HMM is a critical task. In section, we use two commonly used criteria: AIC and BIC to evaluate HMM performance with different numbers of states. These criteria apply to HMMS because, in the model training algorithm, namely the Baum-Welch algorithm, the EM method is used to maximize the log-likelihood of the model. We limit the number of states from two to six to keep the model simple and feasible for stock predictions. Each of these criteria is calculated using the following formula: where, k = N 2 + 2N − 1, In this paper, I will use BIC as the measurement of the model performance to select the best company of the four by the HMM.

4.Experimental analysis
Mean Absolute Percentage Error (MAPE) can be defined as In this project, the main objective is to determine the efficiency of HMMS in predicting stock prices. We use the open source python library hmmlearn to train the model and compute the likelihood of observations. I have observed 2520 groups of statistic from August 23, 2013 to June 27, 2023 of the daily open, close, high and low for Dior, Europe's high-end eyewear giant EssilorLuxottica (ESLX), the French luxury giant Kering (PRTP) and the Swiss luxury giant Richemon (CFR) each. We forecast prices for the last 100 days starting at day 100, then rescale the model using its true observations to forecast prices at day 99, and so on. After calculating the MAPE, I plotted them into the following line graphs in order to compare with the actual figures evidently. After that, I optimize the model by choosing the model with the smallest BIC value, which is a function of the number of states.
The following four figures (Figure 1 to Figure 4) containing four line charts showing close price, open price, high price and low price of DIOR, ESLX, CFR and PRTP each and every graph are showing with the predicted and actual price by black full line and red dotted line respectively. In these graphs, readers can clearly distinguish which of the four companies are more suitable for using the Hidden Markov Model after observing the difference between the two lines in each graph. However, to get the high level of accuracy, I will then apply MAPE to recheck the result.  Figure 1 to 4, we can find that the red dotted line is plotted surrounding the predicted black full line, which indicates that the HMM is performing well in predicting the stock price numbers and trends.  Table 1 below. In the equation of the MAPE, we know that the higher the MAPE is, the more error the HMM has caused.

Result
Implementing the HMM to observe the trends revealed from the corresponding true figures, I reach the predicted numbers of Open, Close, High, and Low and conclude that the final results from the two ways give similar MAPE values. The HMM model is more acute when predicting the following trend from the fluctuant stock prices. Having said that the predicted result of the HMM shows its attention to the stock volatility, it is tough for it to reach the accurate price of the turning points in volatility. There is still a certain level of error in the fluctuating areas. However, in general, the HMM can give investors the right trend for future stock prices.
When it comes to the MAPE values, the PRTP is performing the best in the four generally, with the lowest average number of the four MAPE, followed by DIOR. Nevertheless, in most cases in reality, the investors care more about the errors of the high price and low price. In the table, both DIOR and PRTP are still shown with good performance. All in all, DIOR and PRTP are well-fitted with the HMM, while ESLX and CFP are still needed to be inspected.

Conclusion
Having said that the chosen models can make great impacts on the observation in most cases including the quantity of states in HMM, it is not such challenging when we try to find the optimal state using the BIC method to find the optimal model. The volatility is captured clearly by the use of HMM. When comparing the four companies, the HMM is always a good method to predict the stock prices, and select the proper one to invest in. Nevertheless, to decide which of the four companies is the fittest one for the stock traders using the Hidden Markov Model, the one who shows with less turning point should be chosen. Therefore, with the above conclusion and the visible graphs and the accurate table, PRTP is the best one applying to the HMM.