# 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.