# A Framework for Market State Prediction with Ontological Asset Selection: A Multimodal Approach
## 4 Materials and Methods
### Ontology-Based Stock Selection
#### 4.3.5 Forecasting Using Long Short-Term Memory (LSTM)  
The LSTM forecasts future market conditions by combining temporal dependencies from NMC predictions, sentiment analysis of financial news using BERT (Transformers v4.47.1), and external factors like the Volatility Index (VIX) and GARCH volatility. This integration enables the model to effectively tackle both systemic and idiosyncratic risks.  
The VIX acts as a measure of overall market sentiment and uncertainty, indicating changes in global risk perception. On the other hand, the GARCH model offers detailed insights into asset-specific volatility by dynamically estimating returns' conditional variance. When combined, these variables improve the model's capability to capture market dynamics across different conditions. This enhancement is illustrated by [PERSON] et al. (2021) [38], who emphasized the importance of integrating financial and macroeconomic indicators into machine learning models.  
The choice to prioritize the VIX over other macroeconomic indicators or geopolitical variables stems from its unparalleled capacity to encapsulate multiple aspects of market risk and sentiment into one actionable measure. Unlike macroeconomic indicators, which frequently reflect past data, or geopolitical factors that can add uncertainty and complexity, the VIX provides a predictive gauge of market volatility.  
Research has demonstrated that the VIX is a strong indicator of systemic shocks and investor sentiment. For instance, [PERSON] et al. (2024) [39] illustrated how the VIX reflects market sentiment and its correlation with broader market dynamics. In a similar vein, [PERSON] (2021) [40] compared the VIX with GARCH family models and underscored its superior effectiveness in capturing real-time volatility and investor expectations. Additionally, [PERSON] et al. (2022) [41] investigated the predictive capabilities of the VIX using advanced modeling techniques, highlighting its relevance in turbulent market conditions.  
This study uses the VIX as a primary input to strike a balance between simplicity and strong predictive capability. This method effectively captures dynamic market conditions while reducing the risks of overfitting or redundancy from using multiple macroeconomic indicators, aligning with its overarching goal.  
By incorporating the VIX alongside other key features such as GARCH volatility, sentiment scores, and liquidity indices, the LSTM architecture is designed to efficiently process these inputs, ensuring accurate market state predictions. As shown in Figure 7, the inputs are processed through a finely-tuned LSTM layer, followed by a dropout layer for regularization, and finally pass through a dense layer that outputs probabilities corresponding to different market states (bull, bear, neutral). This architecture adeptly integrates both systemic and idiosyncratic viewpoints, providing a robust framework for predicting market states.  
The incorporation of these methods, along with the optimized LSTM, greatly enhances predictive accuracy, as confirmed by studies from [PERSON] (2022) [4] and [PERSON] (2018) [1].  
Figure 7: The architecture of the Long Short-Term Memory (LSTM) network designed for market state prediction. The model receives sequential inputs (\(x_{0},x_{1},\ldots,x_{n}\)) and processes them through the LSTM layer, followed by dropout and dense layers. The output layer, with a softmax activation, classifies market states into bear, neutral, or bull categories.