During the Last Holiday, You worked in a Commercial Bank as an Intern In the First week, You were Assigned to Work with the Bond Desk: Introduction to Python Programming Assignment, SMU, Singapore
|University||Singapore Management University(SMU)|
|Subject||Introduction to Python Programming|
You are required to submit one (1) Word document (in Docx format) and one (1) Jupyter Notebook script for this entire TMA. The Word document is regarded as the main submission form in which the marker will assess your work. Thus, you should amply explain the steps you have taken to obtain your answers, inserting images from the Jupyter Notebook if necessary. The Jupyter Notebook should contain the actual code that you have written. This will be executed by the marker when he needs to verify your steps.
During the last holiday, you worked in a commercial bank as an Intern. In the first week, you were assigned to work with the bond desk. The first task given to you is to price two (2) types of bonds, namely: zero-coupon bond and fixed-rate bond.
(a) Develop and implement a function zero_coupon_bond _price° that calculates the price of a zero-coupon bond by accepting 3 input parameters: Par value, market-rate r (yield to maturity) and tenor n (in years),
(b) Develop and implement a function bond_price0 that calculates the price of a fixed rate bond by accepting 4 input parameters: Par_value, coupon_rate, market-rate r (yield to maturity) and tenor n (in years),
coupon _rate* Par _value 1 Par value fixed _rate_bond 0+4″ 0+ It
(c) Solve for the prices for the following bonds, round-off with two (2) decimal places:
Par value = $1000
Market rate = 3%
Tenor = 1 year
Par value = $1000
Coupon rate = 5%
Market rate = 4%
Tenor = 6 years
In the second week of the internship, you were asked to help the capital market financial analyst compute beta and expected return of a stock with the help of the Capital Asset Pricing Model (CAPM). These are the monthly data you have gathered:
|Stock X’s return||Market Index’s return|
(a) Develop and implement a function beta_computallon0 that calculates the beta by accepting 2 input return time series, namely: stock’s return time series rood and market index’s return time series r, ket
13= Cov(run,a ,r„,„the,) Cov(stock
C°11(r market 9 r market)
Coy refers to Covariance and Var refers to Variance.
(b) Develop and implement a function returncomputation0 that calculates the expected return of a stocky by accepting 3 inputs, namely: risk-free rate of expected market return and Beta of the stock,
(c) Solve for the expected return for this stock X in % and round-off with two (2) decimal places:
Expected market return =10%
Risk-free rate = 3%
Beta X, to be calculated, round off with two (2) decimal places.
In the third week of the internship, you were asked to evaluate three (3) projects. They are of the same tenor. The 10-year Treasury bond yield of 10% is used for the cost of capital consideration.
You decide to compare the 3 projects by both the Net Present Value (NPV) and Internal Rate of Return (IRR) methods.
|Projects||year 0||year 1||year 2||year 3||year 4||year 5|
|Z||-5000||2000||-800||3000||– 900||1 000|
(a) Develop and implement a function npv_irr calculation° that will generate three (3) outputs:
initial cashflow, npv calc, IRR calc, by accepting 2 inputs: rate, array, which rate refers to the cost of capital, and array refers to each individual project cashflows.
(b) Calculate and publish the Initial Cashflow, NPV, and IRR for the three (3) projects.
(c) If MR is chosen as the criteria, compare which project is the best in returns. If NPV is chosen as the criteria, explain which project is the best in dollars and cents. If only one (1) project is allowed, explain which criteria will the final decision made.
As for the last assignment in the bank, you were asked to assist the Quant team. You were tasked to investigate the usefulness and limitations of the Curve-fitting technique, also known as Regression.
a) Compute and generate 20 normally distributed random numbers with a random seed of 1, mean of 100, and standard deviation of 10. Arrange them in a 2 by 10 matrix. Name this matrix xy_numbers.
Categorise and extract xy_numbers row-wise, that is, first_row = [ ] and second_row = [ ]. Let x takes the array of first_row and y takes the array of second_row. Display a scatter plot of y against x.
(b) Develop and implement a function to calculate mean square error by accepting 3 numeric list parameters: the regressed y value cap, x_input, and y_input.
Calculate linear regression on numbers and display the regressed line with an x-values span across 100 intervals evenly, from the minimum value to maximum value of x data. Calculate the mean squared error, round off to two (2) decimal places.
(c) Calculate both quadratic and cubic regression on numbers and display the regressed curves, label them clearly for clarity. Calculate their mean squared errors, round them off to two (2) decimal places.
y=ax2+bx+c Y = + Bx2 +Cx + I)
(d) Since numbers have 10 columns of data, calculate degree 9th (= 10 – 1) regression on numbers and display the regressed curve alone, label it clearly for clarity. y= aux9 +Cx8
(e) Criticise the limitation of getting predicted data from a regressed line/curve. List one (1). Explain the application of regression. List one (1).