FINA 6421: Homework 1
Please submit one homework answer set for your group, along with individual print-outs of your code for each member of the team. Groups are expected to work together, but all individuals are expected to maintain their own unique code base (code printouts must be different for each person in the team). The best way to learn the material is to think about how you want to structure your code together as a team, and then actually implement it yourself!
1) Build a function called getTotalReturns() that takes as an input the raw DataFrame of daily data from Compustat provided on the website, and generates daily total returns for common stock only. Note: ‘prccd’, ‘trfd’, and ‘ajexdi’ are the names of the daily columns that correspond to the monthly columns of ‘prccm’, ‘trfm’, and ‘ajexm’.
a. Write out your pseudo code that your team used.
b. Add to your function a code block that prints the number of valid days in the daily data for each asset, and prints to the screen a warning if one of the assets has a different number of days than the rest. Screenshot your output as part of your answer. Do they all have the same number of days? If any are different than the rest, provide the individual day(s) that differ from the rest. len
c. Add a keyword input to the function that allows you to either include preferred stock or omit it from your output. Demonstrate that this works for your function by running it both ways (common stock only or common and preferred together) and printing the output columns.
2) Using your DataFrame of common-stock-only daily total returns, compute the following for each asset (build one table for all together preferably):
a. Mean return
b. Median return
c. Standard deviation of the returns
d. Maximum
e. 95th percentile returns (note: try numpy.percentile)
f. 5th percentile return
3) Using the raw data, plot timeseries of the following for IBM. All plots must have date on the x-axis! Label all axes, and be sure that all plots have an appropriate title
a. Plot the daily price level prccd
b. Plot the daily dividend reinvestment factor trfd
c. Plot the daily share adjustment factor ajexdi
d. What happens to the price of IBM when the share adjustment ajexdi goes from a value of 2 to a value of 1? What happened to make that adjustment necessary?
代写CS&Finance|建模|代码|系统|报告|考试
编程类:C代写,JAVA代写 ,数据库代写,WEB代写,Python代写,Matlab代写,GO语言,R代写
金融类:统计,计量,风险投资,金融工程,R语言,Python语言,Matlab,建立模型,数据分析,数据处理
服务类:Lab/Assignment/Project/Course/Qzui/Midterm/Final/Exam/Test帮助代写代考辅导
天才写手,代写CS,代写finance,代写statistics,考试助攻
E-mail:850190831@qq.com 微信:BadGeniuscs 工作时间:无休息工作日-早上8点到凌晨3点
如果您用的手机请先保存二维码到手机里面,识别图中二维码。如果用电脑,直接掏出手机果断扫描。