Tag: Bonds
Bond Valuation - Binomial Method
by theorangedog on Feb.13, 2008, under Skills
The Models page at foquant.com now features a binomial bond valuation tool. This is a crude first run at this, limiting the valuation to a bond with four periods to maturity.
I wanted to get this thrown together so I can expand upon the periods and the ability to value options on bonds. For now, though, the user can input their own rate tree, or choose a constant rate, and also dictate whether or not the bond has a coupon rate. The math that goes into the binomial tree is quite simple, so if a user needs to add additional periods it should not be exceptionally difficult.
Update 1: I have now also uploaded the same model but allowing for a callable bond with a user-defined call schedule.
Altman’s Z-Score Model
by theorangedog on Feb.06, 2008, under Skills
Using multiple discriminate analysis, Edward Altman created a model that provides guidance regarding a company’s credit health. The model is named The Z-Score Model. Upon providing measures from a company’s financial statements, the model would yield a single variable that is designed to be compared to a pre-specified scale. The placement of the Z-score on the scale would indicate whether a company was likely to head toward bankruptcy.
I implemented the model in Excel, and it can now be accessed through the Models page of the foquant.com website.
This model was also covered in the Fixed Income curriculum for the CFA Level 2 exam.
Code Snippet Test
by theorangedog on Nov.04, 2007, under Skills
I installed the Code Snippet (codesnippet) plugin, so that any copied and pasted code looks nice.
A sample of a simple bond value calculator that I wrote a few months back is below:
-
// this is a test to create a program that calculates bond prices
-
-
#include <iostream>
-
#include <cmath>
-
-
using namespace std;
-
double calc(double coupon, double numyears, double numpmts, double parval, double rdisc);
-
-
int main()
-
{
-
double coupon, numyears, numpmts, parval, rdisc;
-
cout << “Enter the coupon payment: “;
-
cin >> coupon;
-
cout << “nEnter the number of years to maturity: “;
-
cin >> numyears;
-
cout << “nEnter the number of payments per year: “;
-
cin >> numpmts;
-
cout << “nEnter the par value: “;
-
cin >> parval;
-
cout << “nEnter your discount rate: “;
-
cin >> rdisc;
-
cout << “n”;
-
-
calc(coupon, numyears, numpmts, parval, rdisc);
-
-
cout << “nnOnly a sucker would pay more than that.nn”;
-
return 0;
-
}
-
-
double calc( double coupon, double numyears, double numpmts, double parval, double rdisc)
-
{
-
double rdiscbynumpmts, numperiods, value, pvfactor;
-
-
rdiscbynumpmts = rdisc / numpmts;
-
numperiods = numyears * numpmts;
-
pvfactor = pow((1 + rdiscbynumpmts), numperiods);
-
-
value = (coupon * ((1 - (1 / pvfactor))/rdiscbynumpmts)) + (parval * (1 / pvfactor));
-
cout << “The value of this bond is: “ << value;
-
return 0;
-
}
And for the record, I realize that this may not be the most efficient code… its just an example.



