{"id":18238499,"url":"https://github.com/ibaris/finance-tda","last_synced_at":"2025-10-04T18:49:39.438Z","repository":{"id":214234798,"uuid":"735144512","full_name":"ibaris/finance-tda","owner":"ibaris","description":"Topological Tail Dependence: Evidence from Forecasting Realized Volatility","archived":false,"fork":false,"pushed_at":"2024-04-18T08:36:56.000Z","size":784,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-24T07:53:05.204Z","etag":null,"topics":["finance","quant","risk-analysis","topological-data-analysis","volatility-modeling"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibaris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-23T20:28:56.000Z","updated_at":"2024-11-01T15:55:45.000Z","dependencies_parsed_at":"2024-02-13T10:45:56.642Z","dependency_job_id":null,"html_url":"https://github.com/ibaris/finance-tda","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.0714285714285714,"last_synced_commit":"ee84e0581fd9b5e3f8f509f34edc68f547f019ec"},"previous_names":["ibaris/finance-tda"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ibaris/finance-tda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaris%2Ffinance-tda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaris%2Ffinance-tda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaris%2Ffinance-tda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaris%2Ffinance-tda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibaris","download_url":"https://codeload.github.com/ibaris/finance-tda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaris%2Ffinance-tda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278358476,"owners_count":25973946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["finance","quant","risk-analysis","topological-data-analysis","volatility-modeling"],"created_at":"2024-11-05T03:05:51.806Z","updated_at":"2025-10-04T18:49:39.400Z","avatar_url":"https://github.com/ibaris.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://unsplash.com/@alterego_swiss?utm_content=creditCopyText\u0026utm_medium=referral\u0026utm_source=unsplash\"\u003e\n    \u003cp\u003e\n        \u003cimg src=\"./resources/logo/logo.jpg\"\u003e\n    \u003c/p\u003e\n\u003c/a\u003e\n\u003ch2 align=\"center\"\u003eFinance TDA\u003c/h4\u003e\n\u003ch4 align=\"center\"\u003eTopological Tail Dependence: Evidence from Forecasting Realized Volatility\u003c/h4\u003e\n\u003ch5 align=\"center\"\u003e[v-2024.2.3]\u003c/h5\u003e\n\n[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://media1.giphy.com/media/hpddP09Trx1AwSVlgm/giphy.gif?cid=ecf05e47uwg39vrpmksf5f73kcmi8iuy11r9p2l3540j8jfo\u0026ep=v1_gifs_search\u0026rid=giphy.gif\u0026ct=g)\n[![forthebadge](https://forthebadge.com/images/badges/built-with-grammas-recipe.svg)](https://media2.giphy.com/media/q2b0xsUuQFGHDoUVFB/giphy.gif?cid=ecf05e47fb1zlbo33kivfd73z4yzdn97ej6tagfeyacvfojo\u0026ep=v1_gifs_search\u0026rid=giphy.gif\u0026ct=g)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#introduction\"\u003eIntroduction\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#Documentation\"\u003eDocumentation\u003c/a\u003e •\n  \u003ca href=\"#example\"\u003eExample\u003c/a\u003e •\n  \u003ca href=\"#reference\"\u003eReference\u003c/a\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n# Introduction\n\nThis repository hosts the Python package developed from the research presented in the paper [\"Topological Tail Dependence: Evidence from Forecasting Realized Volatility\"](https://doi.org/10.1016/j.jfds.2023.100107) and [repositoy](https://github.com/hugogobato/Topological-Tail-Dependence-Evidence-from-Forecasting-Realized-Volatility) by Hugo Gobato Souto. The package is designed to implement the methodologies and techniques described in the paper, focusing on the application of topological data analysis to understand tail dependence in financial markets.\n\nThe core of this package lies in its ability to model and forecast realized volatility in financial markets through the lens of topological data analysis. It presents a novel approach to understanding the complex relationships in financial data, especially during periods of high volatility or market stress.\n\n# Installation\n\n```cmd\n\u003e pip install fintda\n```\n\nYou can also install the stable version with\n\n```cmd\n\n\u003e\u003e\u003e pip install https://github.com/ibaris/finance-tda/archive/main.zip\n\n```\n\nTo install the in-development version, change the branch name main to the other available branch names.\n\n# Documentation\n\nThe documentation `code` documentation is in `build/docs`.\n\n# Example\n\n## Setup and Data Retrieval\n\nImport Libraries: Import necessary libraries, including numpy, yfinance, and modules from the FinTDA package.\n\n```python\nimport numpy as np\nimport yfinance as yf\nfrom fintda import FinTDA\n%matplotlib inline\n```\n\nDefine Financial Indexes and Date Range: Select the financial indexes and the date range for analysis.\n\n```python\nindex_names = ['^GSPC', '^DJI', '^RUT']  # S\u0026P 500, Dow Jones, Russell 2000\nstart_date_string = \"2000-01-01\"\nend_date_string = \"2022-03-30\"\n```\n\nRetrieve Data from Yahoo Finance: Use yfinance to download historical data for the specified indexes and date range.\n\n```python\nraw_data = yf.download(index_names, start=start_date_string, end=end_date_string)\n```\n\n```console\n[*********************100%%**********************]  3 of 3 completed\n```\n\nData Preprocessing: Focus on adjusted closing prices and compute logarithmic returns.\n\n```python\ndf_close = raw_data['Adj Close'].dropna(axis='rows')\nreturns = np.log(df_close.pct_change() + 1)\nreturns.dropna(inplace=True)\n```\n\n## Financial Time Series Analysis with FinTDA\n\nInitialize FinTDA: Create an instance of FinTDA with the processed returns and predefined weights. If the weights are None, then the weights will be equal to 1/n, where n is the number of assets in the portfolio. Moreover, if the sum of the weights is not equal to 1, then the weights will be normalized to sum to 1.\n\n```python\nweights = np.array([0.5, 0.3, 0.2])  # Define portfolio weights.\nftda = FinTDA(returns, weights)\n```\n\n```console\nRips(maxdim=2, thresh=inf, coeff=2, do_cocycles=False, n_perm = None, verbose=True)\n```\n\nCompute Moving Persistence Diagrams: Use the compute_moving_dgm method to calculate persistence diagrams. This method is essential for analyzing the topological features of the financial time series data.\n\n```python\ndistance = ftda.compute_moving_dgm(plot=True)\n```\n\n```console\nComputing Moving Diagrams: 100%|██████████| 5556/5556 [00:09\u003c00:00, 580.01it/s]\n```\n\n\u003cimg src=\"./resources/figure/output_1.png\"\u003e\n\n# Reference\n\nThe development of this package is based on the research published in **\\*the\\*\\*** following paper:\n\nSouto, H.G. (2023). Topological Tail Dependence: Evidence from Forecasting Realized Volatility. The Journal of Finance and Data Science, 9. DOI: [10.1016/j.jfds.2023.100107](https://doi.org/10.1016/j.jfds.2023.10010)\n\nThe initial implementation from `hugogobato` can be found at:\n[Topological Tail-Dependence Evidence](https://github.com/hugogobato/Topological-Tail-Dependence-Evidence-from-Forecasting-Realized-Volatility?tab=readme-ov-file)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibaris%2Ffinance-tda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibaris%2Ffinance-tda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibaris%2Ffinance-tda/lists"}