关键词 > ISOM2600

ISOM 2600 - Assignment 1

发布时间:2024-05-07

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ISOM 2600 - Assignment 1

In this assignment, a dataset with monthly index level of S&P 500(SP) is provided. The goal is to perform exploratory data analysis with python basic data structure and pandas and data pre-processing skill.

The period covers from Jan 2011 to Dec 2023 (monthly).

Complete the following tasks and answer the questions:

Part I: Understand the example code.

Example 1: Printing the first 5 observations of SP500.

Example 2: Computing the mean and standard deviation of SP500.

Example 3: Generate a line plot of SP500 with a reference line of the mean level.

Example 4: : Generate a histogram of SP500

Part II: Complete the tasks. (Notice each of the missing code to be filled is a single line command, more than one command line will be downgraded)

Task 1: Creating the monthly simple return of SP500. [5pts]

Task 2: Remove the missing value of the return series from Task1. [5pts]

Task 3: Calculate the mean, standard deviation of the return [5pts]; How many observations (returns) are less than the mean? [5pts]

Task 4: Compute 5th-percentile of the monthly return [5pts]; Draw a histogram for monthly return [5pts] and a vertical reference line (red color) of 5th-percentile [5pts].

Task 5: Calculate the mean for all the return less than the 5th-percentile. [5pts]

Task 6: Draw a scatter plot between current month's return (x-asix) and next month's return (y-asix) (use green color dots) [5pts]; According to the scatter plot, does current return help in predicting next month return? Briefly explain. Further confirm your thought by their correlation [5pts]

After completion of all task and questions,

· For Jupyter Notebook/Jupyter lab user: Once you finish implementing all the codes (Please DO NOT clear the outputs), please export the notebook as HTML (see instruction in next page) and submit both your notebook and HTML to Canvas.

· For Google Colab user: Once you finish implementing all the codes (Please DO NOT clear the outputs), use the link below to convert the ipynb file to HTML and submit both your notebook and HTML to Canvas.

· https://colab.research.google.com/github/Mostafa-MR/Convert_ipynb_to_HTML_in_Colab/blob/main/Convert_ipynb_to_HTML_in_Colab.ipynb

For Jupyter Notebook/Jupyter lab user 
Export the code and output as HTML:

Jupyter Notebook: Go “File” > “Download as” > Choose “HTML”

 

Jupyter lab: Go “File” > “Save and Export Notebook As” > Choose “HTML”