Skip to content

Latest commit

 

History

History
76 lines (41 loc) · 2.99 KB

FinancialVisualizationAssignment.md

File metadata and controls

76 lines (41 loc) · 2.99 KB

Week 8 Assignment: Financial Data Analysis with Python

Objective

This week, you will focus on key financial metrics and their coding implementations. The assignment is designed to be easily gradable by ChatGPT based on the quality and correctness of your code, including plotting tasks.


Task 1: Correlation Analysis

Step 1: Code for Correlation Coefficients and Heatmap

  • Write Python code to calculate the Pearson correlation coefficients between the returns of at least three stocks.
  • Plot a heatmap of the correlation matrix using libraries like Seaborn.

Submission: Submit the Python code used to calculate and plot the correlation matrix.

Grading Criteria: Correctness and efficiency of the code, including the plot.


Task 2: Risk and Return

Step 2: Code for Risk and Return Scatter Plot

  • Write Python code to calculate the average return and standard deviation (risk) for the same set of stocks.
  • Plot a scatter plot to visualize the risk and return of the chosen stocks.

Submission: Submit the Python code used to calculate these metrics and plot the scatter plot.

Grading Criteria: Correctness and efficiency of the code, including the plot.


Task 3: Sector Analysis

Step 3: Code for Sector Performance Metrics and Bar Chart

  • Write Python code to fetch and interpret the performance of a chosen sector. The code should output specific metrics like YTD return, P/E ratio, etc.
  • Plot a bar chart to visualize the performance metrics of the chosen sector.

Possible Data Source: You can use APIs like Alpha Vantage, Yahoo Finance, or Quandl to fetch sector performance data.

Submission: Submit the Python code along with the output metrics and bar chart.

Grading Criteria: Correctness and efficiency of the code, including the plot, as well as the relevance of the chosen metrics.


Task 4: Efficient Frontier

Step 4: Code for Efficient Frontier Plot

  • Write Python code to simulate and plot the efficient frontier based on a set of portfolios generated from the chosen stocks.

Submission: Submit the Python code used to generate and plot the efficient frontier.

Grading Criteria: Correctness and efficiency of the code, including the plot, as well as the relevance of the chosen portfolios.


Task 5: Submission and Grading

Step 5: Submit Your Code

  • Submit your Python code for each task in a format that can be easily evaluated by ChatGPT, including the plots.

Grading Criteria: Each task will be graded based on the correctness and efficiency of the submitted code, including the plots.


Hints

  • For all tasks, you can use Python libraries like Pandas, NumPy, and Matplotlib, but the focus is on your ability to write correct and efficient code.
  • Make sure to comment your code to explain what each part is doing. This will not only make it easier to grade but also help you understand your own work better.
  • You can discuss your code and its outputs with your peers and also with ChatGPT before final submission.