Rolling_returns_in_5_years_with_distribution_summary.ipynb performs financial data analysis focusing on rolling returns over 5-year periods for various market indices and ETFs. Here is a summary of the key content and steps in the notebook:
- Installs the
yfinancelibrary for downloading financial data. - Imports required libraries:
yfinancefor fetching historical market data.pandasfor data manipulation and analysis.
- Downloads historical closing price data for various equity indices and ETFs.
- Tickers included: EWI, EWJ, EWW, ISF.L, MCHI, SMICHA.SW, SPY, VEA, VNM, VT, VWO.
- Data covers a long historical range, from early 1990s to 2025.
- Prices are stored in a DataFrame with dates as the index.
- Allow to use a
reference_pricefor the analysis
- Displays the head (first few rows) of the closing prices DataFrame.
- Data shows NaNs for dates before the instruments had prices and values for later dates.
- Computes 5-year rolling returns for each ticker.
- This involves calculating the percentage change in prices over every rolling 5-year window in the dataset.
- Summarizes the 5-year rolling returns by computing statistical percentiles:
- 2nd percentile
- 5th percentile
- Median return
- 95th percentile
- 98th percentile
- Also records the first and last available dates for each ticker's data.
- Displays tables showing:
- Summary statistics of rolling returns distributions for each ticker.
- Date ranges covered by the data.
- These statistics help understand the risk and return characteristics of each instrument over 5-year investment horizons.
This notebook analyzes the historical performance of global indices and ETFs by examining their 5-year rolling returns and the distribution of those returns, useful for evaluating long-term investment risk and potential gains.