# program設計程序代寫、Python，C++,CSS編程實驗代做

- 首頁 >> CS作業 Project 1 – Building a Pricing Platform

The project

Build a platform that can be helpful to price options on bonds for any maturity up to 30 years. You can do up to 10 years if it turns out to take computationally long time.

What is the purpose of this project?

In two sentences: Being able to develop a platform for options on interest rates using both the BDT and Vasicek models (as well as Hull and White model as a bonus). This project will allow you to understand how to get raw data from a data source, run bootstrap, build interest rate curves, and then use the curves to construct pricing functions.

Why this project?

Simply because

1)It covers everything from getting raw data, data quality check, understanding yields and spot rates, bootstrapping and interpolation to build pricing models

2)I want you to get your hands dirty and learn to build pricing models in a programming environment

3)Hopefully you will be able to understand how to perform a sensitivity analysis and stress test.

Project Guidance

Key Requirements

?Proficiency in programming: You must learn to build functions for all the key tools and models which will be used in this assignment. Usage of Python is recommended for higher chances of getting job interviews, though R, MATLAB or others can be used. I would advise against using the built-in functions for these tasks as this would not provide you with sufficient understanding of the underlying methodology of these models as you may naively use the results generated.

?I would encourage you to take help from online resources (e.g., Stack Overflow); however please do not simply copy-paste any code chunk you may find there, instead take inspiration from the examples there and build your own algo .

?It is understandable that not everyone (in your team) will be proficient in coding. So, in case of team works, it will be prudent to ensure that all the responsibilities related to this assignment are properly distributed amongst the team members based on their skill sets and learning objectives.

Some Key Steps

1)Getting the raw data that you need from Federal Reserve, the Fed St Louis, the Fed New York, etc.

2)Check the data quality and clean them if data errors would be suspicious (e.g., outlier values, sudden big jumps)

3)Bootstrapping.

4)Interpolation (please use both Spline and Nelson Siegel methods).

5)Value the interest rate option using both Vasicek and BDT models. For the BDT model use monthly time series.

I just want everyone / team to:

?Discuss which option to sell (Call or Put, for which maturity). Just be internally consistent with any assumptions you may make.

?Develop a platform in your preferred language that allows you to price interest rate options.

?Price the option using two methodologies. (We will cover Black-Derman-Toy Model and The Vasicek model in class. If time allows, we can cover Hull-White model as well)

?The platform should be able to give on-time OTC quotes for different maturities

?Compare the prices that you get with each model. Understand why they are different.

?Explain the errors in valuation that comes from interpolation errors and which method is better for this exercise.

?To be able to understand the exposure to your firm as well as coming up with a fair prices (OTC), your model should (ideally) be able to determine how your option prices are affected by

?Interest rate volatility

?The historical window you are choosing to compute the historical volatility (an important input for the BDT model)

?The time step in BDT model

As a guideline, the project may be structured in three installments as below. You may choose the deadlines for each of the installments at your discretion (e.g., Installment 1 within a week from today, Installment 2 within three weeks, and Installment 3 within 6 weeks). These illustrative deadlines are not binding. The only binding deadline is 6 weeks from today (i.e., Thursday April 8, 2021)

Installment 1

Requirements

1)Getting the historical (last 10 years or so) Treasury yield weekly data series. There are many sources for this data, such as Federal Reserve (http://www.federalreserve.gov/releases/h15/data.htm), Fed St. Louis (http://research.stlouisfed.org/fred2/categories/115), the Fed NY, and etc.

2)Interpolating the yields, using linear or non-linear interpolation such as Cubic Spline interpolation.

3)Bootstrapping the spot rates for each data series.

Some Guidance

?The yield data you get from the sources mentioned above are “Treasury Yield Curve Rates”. To be able to do this part of the project, make sure you know what they mean. You need at least understand the assumptions behind Yield Curve in its Frequently Asked Questions (http://www.treasury.gov/resource-center/faqs/Interest-Rates/Pages/faq.aspx).

?The final output of this instalment should have bootstrapped spot rates for each weekly yield data series at each market-available maturity (1-month, 3-month, 6-month, 1-year, 2-year, 3-year, 5-year, 7-year, 10-year, 20-year, and 30-year).

?Linear Interpolation vs. Cubic Spline Interpolation of YTMs

?If you chose to use linear interpolation for the yields, the bootstrapped spot rates for each weekly data series at each market-available maturity (1-month, 3-month, 6-month, 1-year, 2-year, 3-year, 5-year, 7-year, 10-year, 20-year, and 30-year) will need to be interpolated in Instalment 2 to get the smoothed spot curves over monthly times intervals, using both Spline and Nelson Siegel methods. In this case, Installment 1 will require less time to complete while Installment 2 will require more.

?If you chose to use Cubic Spline to interpolate the yield data (from which you will have smoothed yield curves), the resulting bootstrapped spot curves will be smooth. That means you will not need to run the Cubic Spline interpolation of spot rates in Installment 2 (just use the Spline parameters you have obtained in Instalment 1 to calculate the spot rate each month). In this case, Installment 1 will require more time to complete while Installment 2 will require less.

?Hence it may be more time-efficient if you start with non-linear spline than linear interpolation from the beginning.

Installment 2

Requirements

1)Interpolation of Spot Rates

?Interpolation results should be in monthly intervals, which is required for BDT model in Instalment 3.

?Use both Cubic Spline and Nelson Siegel methods to interpolate the spot rates of each data series at each market available maturity (1-month, 3-month, 6-month, 1-year, 2-year, 3-year, 5-year, 7-year, 10-year, 20-year, and 30-year) you have bootstrapped in Instalment 1 to obtain smoothed spot curves.

Note: if you have used Spline method to interpolate the yields data in Installment 1, then you only need to run Nelson Siegel to interpolate the spot rates for this instalment. For Spline interpolation of spot rates, just use the Spline parameters you have obtained in Instalment 1 to calculate the spot rate each month.

2)For each maturity, calculate the Annual Volatility of the historical spot rates for that maturity.

?Technical Note: Standard deviation of the spot rate is NOT the same as volatility. For continuous compounding spot rates, volatility is the standard deviation of natural logarithm of changes in spot rates, i.e., .

Some Guidance

?Installment 2 should already include your Installment 1’s outputs because Installments are sequential.

?Volatility calculation should be based on a certain historical time window (e.g. last 260 weeks). Ideally, the volatility calculation should be flexible to given time window input instead of being hard-coded. This will help you in Installment 3 where you will need to pick an appropriate window to calculate the volatility for pricing the option and potentially perform sensitivity analysis.

?This instalment will likely take the longest time to do (according to past experiences). Make sure you start early.

Installment 3

Requirements

1)Value the interest rate option that you think is appropriate for your client’s hedging need, using both Vasicek and BDT models.

oUse both the analytic method and simulation method under Vasicek to price the option

oFor BDT, use monthly steps

2)Compare the prices that you get with each model. Understand why they are different.

3)Explain the errors in option valuation that comes from interpolation errors. Which method is better for this exercise?

4)Make a decision at what price you will be selling the option to the client. (Hedging your position has to be crucial to your team. Also remember that you are competing with other places, you cannot just be crazy and charge high prices. None of clients will buy over-valued products).

5)Perform sensitivity analysis.

Some Guidance

?It must include all installments. This is the final product of the project that you grade will be based on.

?This is where you perform all the qualitative analysis and come out with a final recommendation.

?Make sure you start early.

Final Deliverables:

1)Your codes

2)Outputs in csv or Excel format

3)A report outlining the necessary steps you have done in your analysis, which may include:

a.Step-by-step brief description of the algorithms for the tools and models alongside the requirements for each section

b.Interpretation of your results (including tables and charts etc.)

c.Sensitivity Analysis

d.Final Recommendation

Bonus

If you want higher grades, then use The Hull-White Trinomial Tree instead of the BDT with monthly steps to price the bond option.

?Use the same interest rate curves

As for volatility and mean reversion rate, you can use the values you obtained from calibrating your Vasicek model.

The project

Build a platform that can be helpful to price options on bonds for any maturity up to 30 years. You can do up to 10 years if it turns out to take computationally long time.

What is the purpose of this project?

In two sentences: Being able to develop a platform for options on interest rates using both the BDT and Vasicek models (as well as Hull and White model as a bonus). This project will allow you to understand how to get raw data from a data source, run bootstrap, build interest rate curves, and then use the curves to construct pricing functions.

Why this project?

Simply because

1)It covers everything from getting raw data, data quality check, understanding yields and spot rates, bootstrapping and interpolation to build pricing models

2)I want you to get your hands dirty and learn to build pricing models in a programming environment

3)Hopefully you will be able to understand how to perform a sensitivity analysis and stress test.

Project Guidance

Key Requirements

?Proficiency in programming: You must learn to build functions for all the key tools and models which will be used in this assignment. Usage of Python is recommended for higher chances of getting job interviews, though R, MATLAB or others can be used. I would advise against using the built-in functions for these tasks as this would not provide you with sufficient understanding of the underlying methodology of these models as you may naively use the results generated.

?I would encourage you to take help from online resources (e.g., Stack Overflow); however please do not simply copy-paste any code chunk you may find there, instead take inspiration from the examples there and build your own algo .

?It is understandable that not everyone (in your team) will be proficient in coding. So, in case of team works, it will be prudent to ensure that all the responsibilities related to this assignment are properly distributed amongst the team members based on their skill sets and learning objectives.

Some Key Steps

1)Getting the raw data that you need from Federal Reserve, the Fed St Louis, the Fed New York, etc.

2)Check the data quality and clean them if data errors would be suspicious (e.g., outlier values, sudden big jumps)

3)Bootstrapping.

4)Interpolation (please use both Spline and Nelson Siegel methods).

5)Value the interest rate option using both Vasicek and BDT models. For the BDT model use monthly time series.

I just want everyone / team to:

?Discuss which option to sell (Call or Put, for which maturity). Just be internally consistent with any assumptions you may make.

?Develop a platform in your preferred language that allows you to price interest rate options.

?Price the option using two methodologies. (We will cover Black-Derman-Toy Model and The Vasicek model in class. If time allows, we can cover Hull-White model as well)

?The platform should be able to give on-time OTC quotes for different maturities

?Compare the prices that you get with each model. Understand why they are different.

?Explain the errors in valuation that comes from interpolation errors and which method is better for this exercise.

?To be able to understand the exposure to your firm as well as coming up with a fair prices (OTC), your model should (ideally) be able to determine how your option prices are affected by

?Interest rate volatility

?The historical window you are choosing to compute the historical volatility (an important input for the BDT model)

?The time step in BDT model

As a guideline, the project may be structured in three installments as below. You may choose the deadlines for each of the installments at your discretion (e.g., Installment 1 within a week from today, Installment 2 within three weeks, and Installment 3 within 6 weeks). These illustrative deadlines are not binding. The only binding deadline is 6 weeks from today (i.e., Thursday April 8, 2021)

Installment 1

Requirements

1)Getting the historical (last 10 years or so) Treasury yield weekly data series. There are many sources for this data, such as Federal Reserve (http://www.federalreserve.gov/releases/h15/data.htm), Fed St. Louis (http://research.stlouisfed.org/fred2/categories/115), the Fed NY, and etc.

2)Interpolating the yields, using linear or non-linear interpolation such as Cubic Spline interpolation.

3)Bootstrapping the spot rates for each data series.

Some Guidance

?The yield data you get from the sources mentioned above are “Treasury Yield Curve Rates”. To be able to do this part of the project, make sure you know what they mean. You need at least understand the assumptions behind Yield Curve in its Frequently Asked Questions (http://www.treasury.gov/resource-center/faqs/Interest-Rates/Pages/faq.aspx).

?The final output of this instalment should have bootstrapped spot rates for each weekly yield data series at each market-available maturity (1-month, 3-month, 6-month, 1-year, 2-year, 3-year, 5-year, 7-year, 10-year, 20-year, and 30-year).

?Linear Interpolation vs. Cubic Spline Interpolation of YTMs

?If you chose to use linear interpolation for the yields, the bootstrapped spot rates for each weekly data series at each market-available maturity (1-month, 3-month, 6-month, 1-year, 2-year, 3-year, 5-year, 7-year, 10-year, 20-year, and 30-year) will need to be interpolated in Instalment 2 to get the smoothed spot curves over monthly times intervals, using both Spline and Nelson Siegel methods. In this case, Installment 1 will require less time to complete while Installment 2 will require more.

?If you chose to use Cubic Spline to interpolate the yield data (from which you will have smoothed yield curves), the resulting bootstrapped spot curves will be smooth. That means you will not need to run the Cubic Spline interpolation of spot rates in Installment 2 (just use the Spline parameters you have obtained in Instalment 1 to calculate the spot rate each month). In this case, Installment 1 will require more time to complete while Installment 2 will require less.

?Hence it may be more time-efficient if you start with non-linear spline than linear interpolation from the beginning.

Installment 2

Requirements

1)Interpolation of Spot Rates

?Interpolation results should be in monthly intervals, which is required for BDT model in Instalment 3.

?Use both Cubic Spline and Nelson Siegel methods to interpolate the spot rates of each data series at each market available maturity (1-month, 3-month, 6-month, 1-year, 2-year, 3-year, 5-year, 7-year, 10-year, 20-year, and 30-year) you have bootstrapped in Instalment 1 to obtain smoothed spot curves.

Note: if you have used Spline method to interpolate the yields data in Installment 1, then you only need to run Nelson Siegel to interpolate the spot rates for this instalment. For Spline interpolation of spot rates, just use the Spline parameters you have obtained in Instalment 1 to calculate the spot rate each month.

2)For each maturity, calculate the Annual Volatility of the historical spot rates for that maturity.

?Technical Note: Standard deviation of the spot rate is NOT the same as volatility. For continuous compounding spot rates, volatility is the standard deviation of natural logarithm of changes in spot rates, i.e., .

Some Guidance

?Installment 2 should already include your Installment 1’s outputs because Installments are sequential.

?Volatility calculation should be based on a certain historical time window (e.g. last 260 weeks). Ideally, the volatility calculation should be flexible to given time window input instead of being hard-coded. This will help you in Installment 3 where you will need to pick an appropriate window to calculate the volatility for pricing the option and potentially perform sensitivity analysis.

?This instalment will likely take the longest time to do (according to past experiences). Make sure you start early.

Installment 3

Requirements

1)Value the interest rate option that you think is appropriate for your client’s hedging need, using both Vasicek and BDT models.

oUse both the analytic method and simulation method under Vasicek to price the option

oFor BDT, use monthly steps

2)Compare the prices that you get with each model. Understand why they are different.

3)Explain the errors in option valuation that comes from interpolation errors. Which method is better for this exercise?

4)Make a decision at what price you will be selling the option to the client. (Hedging your position has to be crucial to your team. Also remember that you are competing with other places, you cannot just be crazy and charge high prices. None of clients will buy over-valued products).

5)Perform sensitivity analysis.

Some Guidance

?It must include all installments. This is the final product of the project that you grade will be based on.

?This is where you perform all the qualitative analysis and come out with a final recommendation.

?Make sure you start early.

Final Deliverables:

1)Your codes

2)Outputs in csv or Excel format

3)A report outlining the necessary steps you have done in your analysis, which may include:

a.Step-by-step brief description of the algorithms for the tools and models alongside the requirements for each section

b.Interpretation of your results (including tables and charts etc.)

c.Sensitivity Analysis

d.Final Recommendation

Bonus

If you want higher grades, then use The Hull-White Trinomial Tree instead of the BDT with monthly steps to price the bond option.

?Use the same interest rate curves

As for volatility and mean reversion rate, you can use the values you obtained from calibrating your Vasicek model.