Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Calculate yield to maturity (YTM) and bond prices. A continuous compounding convention for YTM calculations should be used. The bond declaration may look something like:

class bond {
public:
      bond() {}
      ~bond() {}
      bond(double T0,double C0, double P0,double t0);
      void set_price(double Price0);
double get_price();
      void set_YTM(double YTM0);
      double get_YTM();
      double T;  
      double t;
      double C;
      double P;
private:
      double Price;
      double YTM;
};
 
You may also wish to include additional methods and attributes. The reason why the original time to maturity, T, the current time, t, the coupon payments, C, and the principal, P, are public fields, whereas the Price and Yield to maturity are defined as private fields is that the former are general attributes of a bond and can take on arbitrary (nonnegative) values, whereas the latter two are linked: one implies the other.
 
b)  Create a method that calculates the bond price, given, YTM T, t, C and P.

c)  Create a method that calculates the YTM, given Price, T, t, C and P.

d)  Write a program that uses your class to calculate the YTM for a bond and the price of another bond. An example is shown below

e) Given parameters: T=10, t=0.75, C=4, P=100, YTM=0.045, what is the price of the bond?

f) Given parameters: T=25, t=0.5, C=80, P=1000, Price=1010, what is the (continuously compounded) YTM of the bond? Use your program to calculate the answer.

2.  Term structure

Since there are only a finite number of bonds available in the market. There will always be "holes" to fill in when defining a yield curve in continuous time. A common approach is to define a parameterized set of possible yield curves, and choose a curve within this set that provides a good approximation of the yields of observed bonds. There are many ways to choose such a parameterized set and to define what is meant by a "good approximation." You can read a book on term structure estimation if you are interesting in learning more.

In this exercise, we will use the Nelson-Siegel parametric class of term structures

The Nelson

Siegel model defines a set of zero-coupon yield curves, defined by five parameters, as described in class, i.e., the yield of a zero coupon bond of maturity T is y(T|A), where A =  {β1, β2, β3, λ12}
where ={).The model has been covered in class.
 
A "good approximation" is now defined in the least square sense. Assume that there are n bonds available, with observed prices P1...Pn. Given the Nelson-Siegel yield curve y(T|A), the price would be ?? ^??(Λ).  The residual between observed and estimated prices is then

1946_Nelson-Siegel parametric class.png

The yield curve that minimizes this residual is the so-called least square solution. In other words the parameter set,  is chosen to minimize the residual e, leading to the yield curve y(T|). This is the yield curve we will model in this exercise.
 
a)  Design a term structure class, call it TermStructure, based on the Nelson-Siegel term structure. An object is defined by its attributes, and there should be methods for calculating:

a.  The yield at any positive maturity

b.  The short rate

c.  The forward rate, F(S,T). 
 
Of course, the class needs constructors, destructors and ways to reach its attributes. Store the class declaration in a file called TermStructure.h and the class implementation in TermStructure.cpp

b) Add a method that takes a bond and calculates its price, given the Nelson-Siegel yield curve, with parameters.

c) Write a program that shows how a) and b) work. For example, the program could do the following

d) What is the price of the bond given in the previous figure, when the Nelson-Siegel parameters   =1 are chosen?
 
e) Estimation of the yield curve using nonlinear least squares minimization: The last part of this assignment asks you to construct the Nelson Siegel yield curve from observed bond prices, by minimizing the mean squared error.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9716487
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Consider the following half-reactionsoxidation

Consider the following half-reactions: Oxidation: 2I - (aq)  --> I 2(aq)  +2e - Reduction: MnO 4 - (aq)  +8H + (aq)  + 5e -  -->Mn 2+ (aq)  + 4H 2 O (l) a) Write the overall reaction. b) A galvanic cell based on this rea ...

Access your browsers security settings and configure the

Access your browser's security settings and configure the browser to refuse all cookies or to prompt you before allowing a cookie. Restart the browser; then visit several different Web sites. Be sure to visit popular sit ...

Use the normal model n110756 for the weights of steersa

Use the Normal model ?N(1107?,56) for the weights of steers. A) What weight represents the 49th Percentile? B) What weight represents the 99th Percentile? C) What's the IQR of the weights of these steers?

Question this discussion focuses on mapping cloud security

Question: This discussion focuses on mapping cloud security controls to existing frameworks or regulations. You will need to create 1 new thread AND post AT LEAST 2 comments on other students' threads. Here's how to get ...

Question suppose you are considering an improvement to a

Question : Suppose you are considering an improvement to a computer program. The improvement is applicable only to a fraction 35% of the program and the speedup of the improved fraction is 15. What is the overall speedup ...

Question social networks facebook twitter linkedin etc are

Question : Social Networks (Facebook, Twitter, LinkedIn, etc.) are widely used today. Describe how this technology can be used effectively in a business setting. Are there any drawbacks or limitations to using social net ...

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Question suppose you are given an instance of the

Question : Suppose you are given an instance of the fractional knapsack problem in which all the items have the same weight. Show that you can solve the fractional knapsack problem in this case in O(n) time.

Identify at least two 2 factors that have led to the

Identify at least two (2) factors that have led to the explosive growth of digital crime over the past a few decades. Next, describe the most common forms of digital crime, and give your opinion as to why those forms you ...

I am studying java for the first time and i am using a

I am studying java for the first time and I am using a program called Eclipse to build my programs. I am working with arrays and I am tasked with the following: Create a method that restores an image in which each pixel ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As