Calculate yield to maturity ytm and bond prices a

Assignment Help Computer Engineering
Reference no: EM13346870

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.

Reference no: EM13346870

Questions Cloud

Purchased merchandise from abilene company for 6000 under : purchased merchandise from abilene company for 6000 under credit terms of 110 n30 fob destination invoice dated august
When a process enters the cpu your program must now forkand : when a process enters the cpu your program must now forkand exe a stand alone child process. you must use glxgears for
Leadership and transformationhow does your transformational : leadership and transformationhow does your transformational experience illustrate - or refute - a leadership
You are the nal voter in a brand new start-up league the : you are the ?nal voter in a brand new start-up league the ultra fun foosball league uffl. the directors are looking to
Calculate yield to maturity ytm and bond prices a : calculate yield to maturity ytm and bond prices. a continuous compounding convention for ytm calculations should be
Theory of interestnpv irr nominal and real amortization : theory of interestnpv irr nominal and real amortization sinking fund twrr dwrr1. given npv-1000500v3800v8 and a rate of
1let s1 and s2 be two strings of lengths m and n : 1.let s1 and s2 be two strings of lengths m and n respectively. by de?nition a superstring of s1 and s2 is one which
Create a cost-benefit analysis to evaluate the projectthe : create a cost-benefit analysis to evaluate the projectthe state of massachusetts would like to replace a national guard
Q1 figure shows a scale drawing of the temperature profile : q1 figure shows a scale drawing of the temperature profile through a composite plane wall.i identify the layer with the

Reviews

Write a Review

Computer Engineering Questions & Answers

  How to generate the computer code

I have not seen them yet, but the wave appears to be toward a complete English ability to write down computer programs.

  Explain how a packet is encapsulated

Explain how a packet is encapsulated

  How to compute an arithmetic mean(average), median

I want to compute an arithmetic mean(average), median, and mode for up to 50 test scores. The data are contained in a text file. To determine the median, I must first sort the array. The median is the score in the middle of the range.

  Characterize the company''s personnel as its human asset

Why do we characterize the company's personnel as its human asset? Explain and exemplify.

  Similairities and differences between memory management

Discuss the similairities and differences between memory management compaction and disk compaction.

  How are the enterprise software tools

How are enterprise software tools/enterprise resource planning used in helping to decrease the cost of designing and implementing new systems.

  What is meant by tcp show

Read the research literature to learn what is meant by TCP friendly. Also read the Sally Floyd interview at the end of this chapter. Write a explaining of TCP friendliness.

  How to plan a wan network linking a toy manufacturing plant

How to plan a WAN network linking a toy manufacturing plant? Plan a WAN network linking a toy manufacturing plant (located in Dallas Texas) with two division centres (Los Angeles, California and Pittsburgh, Pennsylvania)

  What is green computing and green communication technology

What is Green Computing and Green Communication technology.

  Define the spirit of the recursion theorem of a program

define the spirit of the recursion theorem of a program.

  What other skills are employers seeking

Beyond the technical skills your degree does/will provide, what other skills are employers seeking? Have a look at job advertisments such as those in CareerOne. Other than technical skills, which skills are employers seeking? (seek.com.au)

  Describe how a sequential file is searched

suppose a sequential file contains 20,000 records and 2 seconds are required to interrogate an entry. How long will we wait when retrieving a record from the middle of the file?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd