This project utilizes various time series models, including the Prophet model, to forecast financial exposure trends for the United States based on historical data. The project explores traditional time series approaches such as Exponential Smoothing and ARIMA, as well as machine learning methods like Long Short-Term Memory (LSTM) networks.
The dataset contains historical financial exposure data by different CBS bank types over time. The data is sourced from the Bank for International Settlements (BIS).
You can download the dataset used in this project from the following link: BIS Data.
This project analyzes the evolution of financial exposure across different categories of banks in the United States, utilizing quarterly data from the BIS global banking dataset. The study focuses on trends, risks, and the impact of the 2008 financial crisis on domestic and foreign banks operating within the U.S. financial system.
The following visualization showcases the trends in financial exposure for various types of banks in the United States, segmented by categories such as Domestic Banks, Foreign Banks, and consolidated financial exposure from parent companies. These charts highlight significant trends before and after the 2008 financial crisis, with an emphasis on systemic risk, international diversification, and post-crisis recovery.
This composite visualization provides a comprehensive view of financial exposure trends across different bank categories in the United States over time, highlighting key developments before and after the 2008 crisis.
1. Domestic Banks (4B & 4R): The financial exposure of domestic banks shows a significant increase starting around 2008, reflecting recovery efforts post-financial crisis. The steep rise in the 4R category suggests a boost in international transactions and investments.
2. All Banks Excluding 4C (4O): A generally increasing trend with volatility highlights the growing exposure to international markets. These fluctuations indicate higher-risk activities abroad, as banks sought to diversify post-crisis.
3. Domestic Banks: The financial exposure for domestic banks (4B) shows steady growth over time, indicating the stabilization of domestic activities and assets after the 2008 financial crisis.
4. Inside-Area Foreign Banks Consolidated by Parent (4C): The steady rise in exposure for foreign banks consolidated by their parent companies (4C) suggests that foreign banks have strengthened their presence within the U.S. financial system post-crisis.
5. All Banks (4M): The exposure for all banks shows sharp increases leading to the 2008 financial crisis, followed by heightened volatility. This indicates increased systemic risk during the crisis, with subsequent recovery marked by fluctuations in financial activities.
The data indicates a marked recovery in financial exposure across various types of banks following the 2008 financial crisis. The increased exposure, particularly post-2008, reflects global diversification strategies and risk management practices as banks sought to stabilize and grow their portfolios. The fluctuations seen in categories such as 4M and 4O demonstrate engagement in higher-risk international activities, likely influenced by changes in global economic conditions and regulatory frameworks.
The consolidation of foreign banks within the U.S. system, as seen in the 4C category, also highlights the growing international presence in the U.S. financial landscape. This trend reflects the overall robustness of the U.S. banking system in adapting to post-crisis challenges and strengthening its global reach.
The dataset contains different CBS bank types. You can adjust the models to forecast for a specific bank type, such as 4B (Domestic Banks). The script automatically handles filtering by the desired bank type.
The plot shows the financial exposure trend for 4B (Domestic Banks) over time, indicating substantial growth, especially after 2005. Below are the results of the ADF test:
The ADF test was used to check the stationarity of the financial exposure data for 4B banks. The following conclusions can be drawn from the test results:
Non-stationary time series data have time-dependent statistical properties, such as varying mean, variance, and autocorrelation. This makes modeling and forecasting difficult using traditional time series methods like ARIMA, which assume that the data is stationary. Non-stationary data may exhibit trends, seasonal effects, or changing volatility over time. To address this:
The Seasonal Autoregressive Integrated Moving Average (SARIMA) model extends ARIMA to handle seasonal time series data. The model is represented as:
SARIMA(p, d, q) × (P, D, Q, s)
Where:
SARIMA is powerful for forecasting time series with both trend and seasonal patterns, making it suitable for use cases like retail sales, climate prediction, and financial data. The model applies seasonal and non-seasonal differencing to make the series stationary, enabling accurate long-term forecasts.
The Prophet model, developed by Facebook, is designed to handle time series data with strong seasonal effects and multiple seasonalities. It automatically detects trends and seasonality and adjusts for holidays or other special events, making it particularly useful for business forecasting such as financial data, stock prices, and more.
In this project, the Prophet model was tuned to predict the financial exposure of 4B Domestic Banks in the U.S. The model effectively captured long-term trends and produced a forecast with confidence intervals, which can be seen in the shaded green area.
The Exponential Smoothing State Space Model (ETS) captures the underlying trends, seasonality, and noise within time series data. It handles both additive and multiplicative components, making it highly effective for time series that exhibit non-linear patterns.
In this project, the ETS model was used to forecast the financial exposure of 4B Domestic Banks in the U.S. The model showed a good fit, especially for the shorter-term forecast, as indicated by the close alignment between the actual data (blue line) and forecast (dashed green line).
The ETS model closely follows the observed financial exposure until 2014. However, after this point, the model struggles to capture the sudden spikes in the data, which is characteristic of exponential smoothing models that prioritize smoothing over sharp volatility. Despite this, the ETS model demonstrates improved short-term forecasting accuracy compared to previous models, as evidenced by its lower MAE and RMSE.
The ETS model exhibits reliable short-term forecasting accuracy and aligns well with actual data for near-term predictions. Although the model may underestimate sharp peaks and volatility, it remains a robust choice for consistent financial exposure forecasting.
The residuals plot represents the differences between the observed financial exposure data and the predictions made by the ETS model. Analyzing the residuals can provide insights into the model's performance over different periods.
The ETS model performed well in stable periods (pre-2000 and post-2012) but struggled during periods of high volatility, especially from 2000 to 2012. The large residual spikes highlight the model’s limitations in handling structural breaks or abrupt trend changes, such as those seen during financial crises.
The ETS (Error, Trend, Seasonal) model provides a forecast of financial exposure for domestic banks, with associated confidence intervals highlighting potential future variability.
The ETS model performs well in capturing the overall trend of financial exposure, but as with any time series forecast, there is an increasing margin of error as we look further into the future. The widening confidence intervals suggest that, while the model predicts continued growth, the exact future values may vary significantly due to external factors, especially during volatile periods.