This project analyzes international trade relationships using network analysis and community detection algorithms to identify trading blocs and patterns.
The code implements:
- Country name standardization between different data sources
- Network analysis of international trade relationships
- Community detection using the Weighted Stochastic Block Model (WSBM)
- Visualization of trade communities and network structure
communities generated for n blocks = 16
communities generated for n blocks = 12
This project analyzes the relationships between stocks in India's NIFTY 150 index using network analysis and community detection techniques. The analysis includes correlation-based edge weights and identifies trading communities using the Weighted Stochastic Block Model (WSBM).
- Correlation network construction from stock price data
- Community detection using WSBM
- Interactive network visualization
- Hierarchical clustering analysis
-
Data Collection
- Stock data for NIFTY 150 companies from yfinance
- Cleaning and preprocessing time series data
- Computing pairwise correlations
-
Network Construction
- Edge weights based on stock price correlations
- Threshold filtering for significant relationships
- Network normalization techniques
-
Community Detection
- Implementation of WSBM algorithm
- Parameter optimization for community detection
- Validation of community structures
-
Network Graph
- Color-coded communities
- Edge weights showing correlation strength
- Interactive spring layout
- Node labels for stock identification
-
Hierarchical Clustering
- Dendrogram visualization
- Distance-based clustering
- Community relationship analysis
Dendogram for communities obtained
graph of communities visualized
We can see it is able to correctly identify various sectors in NIFTY as communities.
| Contribution | Contributors |
|---|---|
| Research and Ideation | Ishaq |
| Data Sourcing | Rohit, Ishaq |
| Trade Database Construction | Nagasai |
| Data Engineering | Nagasai, Shankar |
| Community Generation Code | Rohit, Sathvik |
| Stock Communities Visualization | Sathvik, Rohit, Nagasai |
| Trade Communities Visualization | Rohit |
| Inference | Ishaq |