PYTHON EXERCISE

Python (Coding) Exercise for a Finance Class. Due tonight at 11:59 PM, will pay good money for itΒ 

MSF Bootcamp – Python FIN 635

Final Assignment This individual assignment is due on Thursday 8/6 at 11:59PM. Please submit your answers as a Jupyter Python Notebook. 1. Use SymPy to solve the following equations:

a. ln(π‘₯ + 2) = 10 b. π‘₯ = 4 c. 𝑒 + 𝑒 = 10

2. Using SymPy, plot the following functions:

a. 𝑓(π‘₯) = 1 βˆ’ 𝑒 b. 𝑓(𝑦) = ln(100𝑦) c. 𝑓(𝑧) = 𝑧 + 4𝑧 βˆ’ 2𝑧 + 10

3. Use SymPy to find the derivative of the following functions:

a. 𝑓(π‘₯) = cos(π‘₯ ) b. 𝑓(𝑦) = cos(𝑦 ) + sin(𝑦 ) c. 𝑓(𝑧) = 𝑒

4. Let 𝐴 = 7 4 1 8 5 1 3 10 8

, 𝐡 = 4 7 9

and 𝐢 = (4 4 1). Use SymPy to compute the following:

a. 𝐴 Γ— 𝐡 b. 𝐢 Γ— 𝐴 Γ— 𝐡 c. 𝐢 Γ— 𝐡 d. 𝐡 Γ— 𝐢

5. Download the daily closing prices of Apple (Ticker: AAPL) from 1995-01-01 until the latest closing,

and plot: a. The daily returns of AAPL stock. b. The histogram of AAPL returns using 100 bins.

6. Download the daily closing prices of Apple (Ticker: AAPL) and the SPDR (ticker: SPY) from 1995-01-

01 until the latest closing. Using the library statsmodels, run a regression of daily returns of Apple stock on the SPDR and report:

a. The R-square of the regression. b. The beta of the regression. c. The standard deviation of daily returns of AAPL and SPY. d. The correlation between AAPL and SPY daily returns.

7. Download the interest rate data from Kenneth French’s website from 1950-01-01 until the latest

update and run the regression of the change in monthly interest rates on the one-month lagged monthly interest rate. Report the coefficients of the regression and comment on whether they are statistically significant at the 5% level.