(5/5)

Hire Me
(4/5)

Hire Me
(5/5)

Hire Me
(5/5)

Hire Me

# Attached are two raw data files you will use. They are directly downloaded from third party, so please do not redistribute. These two files have exactly same format, except two different periods

INSTRUCTIONS TO CANDIDATES

## Programming Test in Python

Data

Attached are two raw data files you will use. They are directly downloaded from third party, so please do not redistribute. These two files have exactly same format, except two different periods. You need to link them together and use an overlap period – the months that exists in both files.

Columns: Each column actually represent one security. I will refer to those securities as to “Sectors”. Let’s use the first bucket “Years to Maturity (15,15.25)” as example. It has two/three securities: coupon bond, principle bond, and other. The “total” columns are not useful in this exercise.

Tabs: Each tab is one characteristics of this security you will use. It represents: Weights in benchmark, Maturity, Duration, Yield and Return.

Using Raw Data 2 as example, 2/26/1999, there is one sector with weight 1.88390%, maturity of 15.21, duration of 14.77, yield at “5.986%”; and it is a “coupon bond”. It had a return from 2/26/1999-3/31/1999 equal to -0.09%. So if you collect each of these sector characteristics  for the same month, you should be able to calculate benchmark return for March, benchmark duration, benchmark sector weights for total coupon bonds, total principle bonds, total weights in maturity 15-20 year, etc.

Task 1: Benchmark return and risk

Assume RawData1 file contains data for benchmark 1; and RawData2 file contains data for benchmark 2. Compute the following and save in easy-to-compare CSV file. The CSV file will have three columns:

1. Metric name
2. Benchmark 1
3. Benchmark 2

You have to compute the following metrics for each of benchmark:

1. Annualized return
2. Annualized volatility (standard deviation)
3. Ratio of months with positive returns to all months
4. Maximum drawdown

Note 1: each item from above will go to the column one of the CSV file. For instance,

 Metric name Benchmark 1 Benchmark 2 Annualized return 0.037521 -0.011256 Annualized volatility 0.012345 0.098765 …

Note 2: use an overlap period – the months that exists in both files – to compute these metrics.

Note 3: use all – coupon, principal, and other bonds.

Note 4: to compute one month return, you need to weight returns. In the example above with RawData2 file, the sector with weight=1.88390% and return=-0.09% contributed to the monthly return as (1.88390)/100 * (-0.09)/100. In other words, the formula for monthly return is

, where

Compute and plot for each benchmark:

• monthly returns
• average 12-month moving average return

Compute and show as a single number(s):

• beta of the benchmark 2 returns to the benchmark 1 returns.
• Spearman correlation between the two benchmark monthly returns

1. For each sector calculate “Roll down expected return”.

Roll down expected return of sector A = (Yield of sector A –Yield of sector B )/(Maturity of sector A-Maturity of sector B)* Duration of sector A.

Sector B is the sector with shorter maturity. To find one you need to compare maturity of sector in the RawData1 file vs maturity of sector in the RawData2 file.

Compute separately for coupon, principal, and other bucket. Of course, the roll down expected return can be computed only if the data exist in both files. If not, ignore that sector / date combination.

Save the results in CSV file. Choose your own file structure.

The following is for extra credit:

1. Objective of the optimization is to create a portfolio for each month with highest weighted average roll down expected return.
2. Constraints:
3. Total weights for Coupon bonds or Principle bonds cannot be more than 5% different.
4. You have to bucket all the bonds into maturity buckets (15-17.5, 17.5-20, 20-22.5, 22.5-25, 25-27.5, 27.5-30) each bucket weights cannot be more than 5% different as well. Or weighted average duration of each bucket, cannot be more than 2 year difference. You can play with the constraints. Use some parameters file, so you can change the constraints easier.
5. Total weighted average duration has to match benchmark total weighted average duration.
6. Control turnover, monthly turnover can not be higher than 5%.
7. If you assume coupon bond bid/ask yield is 5bps, and principle bond bid/ask yield spread is 3bps, times the duration of the bond, you can calculate trading cost. Taking into account the trading cost in your optimization to minimize trading cost.
8. The output, using 2/1999 optimized weights to calculate March 1999 return. Comparing that with index return.

The optimization objective: Ideally we can create an optimized portfolio which deliver better return than benchmark, the standard deviation of the return difference each month is less than 50bps.

assignment on finance

## Related Questions

##### . The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

##### . Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

##### . The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

##### . Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

##### . The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme