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.:- M9131225
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question 1in what ways can a hash value be secured so as to

Question: 1. In what ways can a hash value be secured so as to provide message authentication? 2. Elaborate on the applications, weaknesses and limitations of the hashing algorithms The response must be typed, single spa ...

Generate a c program for fibonacci function using

Generate a C++ program for Fibonacci function using Stack Fibonacci function Fib(n) is given below. Fib(n)= Fib(n-1) + Fib(n-2) for n > 1 Fib(n)= 1 for n=1 Fib(n)= 0 for n=0 Using following initialization unsigned int *F ...

Discuss the concept of intrinsic value and how it is

Discuss the concept of intrinsic value and how it is determined. Include a real-world example.

Dud bolt is preparing for the boonta eve classic speeder

Dud Bolt is preparing for the Boonta Eve Classic speeder race and has to make a decision about which racer to bet on. He has calculated his potential payoffs and narrowed it down to two racers shown in the following tabl ...

You are the senior consultant at abacus consulting tasked

You are the Senior Consultant at Abacus Consulting, tasked with the database project for Amadeus Real Estate client. The company employs real estate agents who work with customers to buy and sell properties (both residen ...

Short answer1 describe best case average case and worst

SHORT ANSWER 1. Describe best case, average case, and worst case in terms of Big O Notation. When implementing algorithms or data structures which two "Big O cases" are most important to consider and why? 2. Compare and ...

Inside the oncreate method fill in the code so that we set

Inside the onCreate method, fill in the code so that we set the layout and GUI defined in activity_main.xml? public void onCreate( Bundle savedInstanceState ){ super.onCreate(savedInstanceState); // Your code goes here }

Question sally averages 5 strokes a hole when she plays

Question: Sally averages 5 strokes a hole when she plays golf. One day, she took 40 strokes to complete the first nine holes. Her partner conjectured that she would probably regress to the mean and take 50 strokes to com ...

Lnguage isnbspcgenerate a sparse vector class with

Language is  C++ Generate a sparse vector class with * operator, such as  Vector Vector::operator * (Vector& param) A multiplication (*) operators returns element-wise multiplication of two vectors in another vector. Giv ...

Question suppose that a remote transmitter sends a message

Question : Suppose that a remote transmitter sends a message at 2500 Baud and the receiver is expecting the data rate to be 2400 Baud. Calculate the accumulated sample error for one character. Give the answer in bits.

  • 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