- Introduction
- Project Structure
- Setup Instructions
- Data Sources
- Running the Scripts
- Analysis and Results
- Dependencies
- Contributing
- License
This project aims to analyze the impact of short selling on Volkswagen stock and the broader market during the 2008-2009 financial crisis. The analysis includes:
- Correlation analysis between Volkswagen stock prices and Failures to Deliver (FTD) volumes.
- Regression analysis to explore the relationship between FTD volumes and stock prices.
- Sentiment analysis of news articles related to Volkswagen during the period of interest.
financial_analysis/
├── data/
├─├──FTDs/
├─├──├─cnsp_sec_fails_200{701..812}.txt/
│ ├── volkswagen_stock_prices.csv
│ ├── ftd_data.csv
│ ├── sp500_index.csv
│ └── news_articles.json
├── scripts/
│ ├── download_data.py
│ ├── analyze_data.py
│ └── sentiment_analysis.py
├── requirements.txt
└── README.md
- data/: Directory to store all datasets.
- scripts/: Directory containing Python scripts for data download, analysis, and sentiment analysis.
- requirements.txt: File listing all Python dependencies.
- README.md: Detailed project documentation.
Follow these steps to set up the project on your local machine:
- Clone the repository:
git clone https://github.com/yourusername/financial_analysis.git cd financial_analysis - Install the required packages:
pip install -r requirements.txt
The data used in this project includes:
- Volkswagen Stock Prices: Historical stock prices for Volkswagen.
- Failures to Deliver (FTD) Data: FTD data for Volkswagen.
- S&P 500 Index Data: Historical S&P 500 index data.
- News Articles: News articles related to Volkswagen.
- Download and Parse Data
This script downloads the required datasets and saves them into the data/ directory.
python scripts/download_data.py
paste the data of 2007-2008 files from SEC FTD in the data folder (use curl) these two scripts will parse the data accordingly.
python scripts/parseftd.py
python scripts/convert_text_csv.py- Analyze Data
This script loads and analyzes the data, performing correlation and regression analysis.
python scripts/analyze_data.py
- Sentiment Analysis
This script performs sentiment analysis on the news articles related to Volkswagen.
python scripts/sentiment_analysis.py
The analysis includes the following components:
- Correlation Analysis: Identifies correlations between Volkswagen stock prices and FTD volumes.
- Regression Analysis: Explores the relationship between FTD volumes and stock prices.
- Sentiment Analysis: Analyzes the sentiment of news articles related to Volkswagen during the period of interest. Example Outputs: Correlation Analysis The correlation matrix showing the relationship between Volkswagen stock prices and FTD volumes.
Regression Analysis A summary of the regression analysis exploring the relationship between FTD volumes and Volkswagen stock prices.
Sentiment Analysis A plot showing the sentiment of news articles over time.
The project relies on the following Python libraries:
yfinancerequestspandasmatplotlibseabornstatsmodelstextblob
These dependencies are listed in the requirements.txt file and can be installed using pip install -r requirements.txt.
Contributions are welcome! Please create a pull request or submit an issue if you have any suggestions or find any bugs.