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

  Which type of network devices would be supported

You have been asked to generate a paper that compares and contrasts guided versus wireless media for inclusion in your company's knowledge database.

  Find cause of problems with the users'' personal computers

You are the first-level help desk technician at a medium-sized company. Your job is to handle the initial calls from company computer users with personal computer related problems.

  How insightful is the experimental analysis with the planner

How insightful is the experimental analysis with the planner (how easily the planner solves the instances, how well the planner scales up as the instances are made larger or more complex, how well the results are reported: times, qualityof solutio..

  Make any documentation that normally occur

The Course Project is comprised of several steps that will result in a completed, tested solution. Complete all steps of the development life cycle for a small project of your choosing.

  Write down an application that displays a menu

Write down an application that displays a menu.

  What stages of computation does garbage collection

For a list with n Nodes, what is the maximum number of nodes that are "live" (i.e., accessible from a "root set" of variables) during the method inverse(), and when does this atmost occur.

  What are the hardest things in learning a new language

What is the hardest thing in learning a new language like Java and C++? How best to master these languages for a beginner with only procedual programming language experience.

  Make a class named student

design a class named ShowStudent that instantiates a Student object from th eclass and then display all the vlaues associated with the Student. Save as ShowStudent.java

  Select an employee from the employee table

Choose a job_title_code in the job_title table. Increase the Minimum_salary and Maximum_salary for this job_title_code.

  Is there an error in this pseudocode

There is an error in this pseudocode, can you help me find it?

  Create a class named package with data fields for weight

Create a class named Package with data fields for weight in ounces (oz.), shipping method, and shipping cost.

  Suppose that n is an exact power of 2

imagine that n is an exact power of 2. The circuit consists of a complete binary tree of ripple-carry adders, in which each node in the tree adds two numbers and produces a sum which is fed to its parent.

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