Duration and Convexity Calculator, With the Error Shown
The calculator builds a bond’s payment schedule from its terms and its yield, then returns Macaulay duration, modified duration and convexity. For a chosen yield move it prints the straight line estimate, the same estimate with curvature added, and the full repricing. On the ten year bullet bond a 200 basis point rise leaves the line out by Rs 10.9315/- and the corrected estimate by Rs 0.7625/-.
What does this tool return for a bond entered by hand?
Six fields, and every one of them is a figure read off the instrument or chosen by the person doing the sums. The defaults are the ten year bullet bond worked throughout this calculator, so the panel opens on the example and every figure below it can be checked against the tables further down.
The cash flow table, the three measures, and the two estimates against the repricing
Every payment, discounted, and the two weight columns built from it
| Years out | Payment | Present value | Weight | Weight times years | Curvature weight |
|---|
The three measures, each one a total from the table above
Two estimates and one repricing, on the chosen move
Everything here is arithmetic on one table. A Macaulay duration is not a figure anybody looks up: it is a weighted average of the years a bond's payments arrive in, where each weight is that payment's present valueWhat a future rupee is worth when pulled back to today at a stated rate. A rupee arriving in ten years is worth less than one arriving next year. divided by the total price. So every input this tool needs is an input the price already needed. Convexity reuses exactly the same present values with a different weight on each. Nothing in this tool is a second data source. The calculator holds the payment schedule, rearranged three ways, and one full repricing to check the rearrangement against.
The meaning of these measures, and the reason a straight line laid against a curved relationship is wrong in a known direction, are covered separately. The table, the division, the second weight and the gap appear in the order they are worked. Any answer given here can be reproduced on paper.
What does this tool take in, and what does it refuse to take in?
Six fields carrying four things, and no fifth thing. Four of the fields build the payment schedule, one is the yield, one is the move the estimate is wanted for, and the compounding convention rides on the field marked payments a year. Most calculators of this kind hide one of the four and quietly assume it.
The first of the four is the cash flow scheduleThe list of dated amounts an instrument promises: how much arrives, and how many years out each amount is.: every payment, with its amount and the number of years until it arrives. For the ten year bullet bond used throughout this calculator, that is ten dated amounts. Nine of them are Rs 85.00/- and the tenth is Rs 85.00/- plus the Rs 1,000.00/- face amountThe sum written on the instrument that is repaid at the end. Interest is worked as a rate on it., which is Rs 1,085.00/-. A schedule works the way a household works out a wedding paid for in instalments: what is needed on paper is not one lump and one date, it is every amount and the month it leaves.
The second is the yield, as a rate per year. Here it is 8.50 per cent a year. The third is the compounding convention. The field marked payments a year asks for it outright rather than assuming it. The fourth is the size of the yield move the estimate is wanted for, entered in basis pointsThe unit a rate move is quoted in. Twenty five of them make a quarter of a percentage point, and four hundred make four whole points. rather than in per cent. A rate move is quoted that way in the first place, and converting it in the head is exactly where the mistakes begin.
The convention line, stated wherever a price is computed
Every price, yield and rate in this calculator is on annual compoundingInterest reckoned once a year rather than more often. Reckon it twice a year on the same headline rate and the arithmetic gives different answers.. The same numbers on a semi annual convention produce a different price, a different Macaulay duration, a different modified duration and a different convexity, so it is written next to every price it affects instead of being tucked into a note at the bottom. Which convention attaches to a real instrument is set elsewhere: for government securities by the Reserve Bank of India at rbi.org.in, and for corporate debt by the Securities and Exchange Board of India (SEBI) at sebi.gov.in.
The refusals are as informative as the acceptances. No output depends on a rating, so there is no field for one. Likelihood is not an input to any of these four numbers, and no field asks for a view about where rates are going. A single modified duration is built on one yield applied to every payment, so a second yield for a different part of the schedule has nowhere to go. That last refusal is not a limitation to apologise for. It is the definition of the number that comes back.
Where does each input come from, and in what form?
Field notes, and nothing else: where each figure is found and what shape it has to be in. The panel above carries the same notes beside the fields themselves. The meaning of each figure is covered separately.
| Input | Where it is found | The form it must be in |
|---|---|---|
| The payment schedule | The instrument's own terms: the interest rate applied to the face amount, on the stated frequency, with the face amount added to the final payment | Amount in rupees, and years from today as a number, one row per payment |
| The yield | Backed out of the price. It is the single rate that makes those payments add to what the bond costs, so it comes from the price rather than from any table | A rate per year, as a decimal or a percentage, stated per year |
| The compounding convention | The instrument's terms. Which convention attaches to a real instrument is set by the Reserve Bank of India at rbi.org.in for government securities and by SEBI at sebi.gov.in for corporate debt | A stated frequency. Every figure here is annual |
| The size of the move | A chosen figure. It is not read off anything and it forecasts nothing | A whole number of basis points, signed for a rise or a fall in the yield |
Only one of the four inputs comes from outside the instrument, and that one is the move chosen by the person doing the sums. The other three are all readable off the terms and the price. Anyone holding the same three facts can therefore audit a duration figure, and a duration figure that cannot be reproduced from them is a number somebody typed rather than a number somebody worked.
The yield to maturityThe one discount rate that makes a bond's dated payments add up to exactly the price paid for it. The rate is read off the price rather than looked up. deserves one line of its own here, because it is the input readers most often try to find in the wrong place. The yield is not published for an invented instrument, and not published for most real ones either. The yield is solved for. The schedule and the price are held fixed, and the search is for the one rate that reconciles them. On the ten year bullet bond that rate is 8.50 per cent a year, and the interest rate written on the bond is the same 8.50. A bond whose two rates match prices at parPriced at exactly the face amount. Par pricing happens when the interest rate written on the instrument and the yield are the same number. at Rs 1,000.00/-.
The estimated price change for a 50 basis point move is wanted, and 0.50 is entered into the box marked basis points. What does the tool return?
How does a table of ten payments become one waiting time?
Four moves, in one order, on one table. A reader who can draw this table can audit any answer this calculator or any other returns. The arithmetic is therefore run in the open rather than left inside the machine.
Here is that table, worked in full on the ten year bullet bond at a yield of 8.50 per cent a year, on annual compounding. Read it as three columns of arithmetic and one column of checking.
| Year | Payment | Present value at 8.50 per cent | Weight | Weight times year |
|---|---|---|---|---|
| 1 | Rs 85.00/- | Rs 78.3410/- | 0.078341 | 0.078341 |
| 2 | Rs 85.00/- | Rs 72.2037/- | 0.072204 | 0.144407 |
| 3 | Rs 85.00/- | Rs 66.5472/- | 0.066547 | 0.199642 |
| 4 | Rs 85.00/- | Rs 61.3338/- | 0.061334 | 0.245335 |
| 5 | Rs 85.00/- | Rs 56.5289/- | 0.056529 | 0.282644 |
| 6 | Rs 85.00/- | Rs 52.1003/- | 0.052100 | 0.312602 |
| 7 | Rs 85.00/- | Rs 48.0187/- | 0.048019 | 0.336131 |
| 8 | Rs 85.00/- | Rs 44.2569/- | 0.044257 | 0.354055 |
| 9 | Rs 85.00/- | Rs 40.7898/- | 0.040790 | 0.367108 |
| 10 | Rs 1,085.00/- | Rs 479.8797/- | 0.479880 | 4.798797 |
| Total | Rs 1,850.00/- | Rs 1,000.00/- | 1.000000 | 7.119063 |
The tool is doing exactly this and nothing cleverer. The present values add to Rs 1,000.00/-, which is the price, which is what makes the weights add to one. The weighted years add to 7.119063, and rounded to four places that is the 7.1191 the tool prints. Look at the tenth row for a moment. It carries a weight of 0.479880, so a single payment accounts for a little under half the price and for 4.798797 of the 7.119063. One payment therefore covers 67.41 per cent of the waiting time. The nine interest payments together carry 0.520120 of the weight and only 2.320266 of the waiting time. The asymmetry between the last payment and the nine before it is the whole reason a bullet bond behaves the way it does.
Adding the printed weight column by hand gives 1.000001, and adding the printed year column gives 7.119062 rather than 7.119063. Both are six place rounding residuals, one unit in the last printed place, and neither is a mistake in the arithmetic. The unrounded columns add to exactly one and to 7.119063. Only those totals can be exactly one, so the check in step three is run on them. A column of rounded parts is not obliged to add to its own rounded total, and forcing it to would mean printing one of the parts wrongly.
| CFt | the payment arriving in year t, in rupees, read off the instrument's terms |
| y | the yield per year as a decimal, solved for from the price, 0.085 here |
| t | the number of years until that payment arrives, 1 through 10 here |
| P | the price, which is the sum of all the present values, Rs 1,000.00/- here |
| wt | the weight on year t, a fraction of the price, and the ten of them add to one |
| n | the number of payments, 10 here |
The arithmetic is friendlier than it looks. An everyday version shows why. Suppose a household is saving for four things over the next five years, and Rs 90,000/- of the Rs 1,00,000/- total is needed in year five. If somebody asked when the money is really needed, nobody would answer year three just because that is the middle of the window. The answer would be close to year five. Nearly all the money sits there. A Macaulay duration is that answer, worked properly: the average date, weighted by how much arrives on each date.
The weight column is built and it adds to 0.9971 rather than to one. What went wrong?
What actually changes on dividing by one plus the yield?
The units. The change of unit is the answer, and it is the thing most often missed.
Take the Macaulay duration and divide it by one plus the yield for a single period. The modified duration lands. On the ten year bullet bond the division is 7.119063 over 1.085, and the answer is 6.5613. The modified duration is not a shorter waiting time. The division produced a different kind of number altogether: years went in and a percentage price change per percentage point of yield came out. Both figures describe the identical bond, exactly 1.085 separates them, and swapping one for the other makes the answer wrong by 8.5 per cent of itself.
| Dmac | the Macaulay duration, in years, 7.119063 here |
| y | the yield per year as a decimal, 0.085 here |
| k | payments per year under the stated convention, 1 here because everything in this calculator is annual |
| Dmod | the modified duration, a percentage price change per percentage point of yield, 6.5613 here |
Why the display must carry both words
A calculator that prints a bare duration has built the confusion into its own interface. The two numbers look interchangeable and are different enough to wreck an estimate, so the panel above gives each its own labelled line and its own unit, and never prints the word duration on its own.
The tool returns 7.1191 and 6.5613 for the same bond. Which one is multiplied by a 100 basis point move to estimate a price change?
Why does convexity weight the same present values differently?
Because it is measuring a different thing about them. The Macaulay duration asks how far away each payment is. Convexity asks how sharply each payment responds, and a payment that is twice as far away responds more than twice as much.
The same ten present values are used again, but each is multiplied by the year times the year plus one, and the total is divided by the price and by one plus the yield squared. On the ten year bullet bond that gives 58.4702. Look at what the two multipliers do across the ten years. The duration weight runs 1, 2, 3 and on to 10. The convexity weight runs 2, 6, 12 and on to 110. The near payments barely register in the second column, and the far payment dominates it far more heavily than it dominated the first.
| CFt | the payment arriving in year t, unchanged from the duration table |
| t | the year the payment arrives in, so t times t plus one runs 2, 6, 12 and on to 110 |
| y | the yield per year as a decimal, 0.085 here, on annual compounding |
| P | the price, Rs 1,000.00/- here |
| C | the convexity, 58.4702 here, a pure number with no natural unit |
Convexity has no unit a reader can feel. The panel therefore never shows it on its own, and always shows what it is worth inside an estimate. Nobody has an instinct for 58.4702. People do have one for Rs 10.9315/- on Rs 1,000.00/- of face. A figure with no unit cannot be sanity checked, and the fix is to convert it into rupees rather than to explain the unit better.
Two bonds are entered into this tool and both return a modified duration of 6.5613. One returns a convexity of 58.4702 and the other 49.0986. What has that established?
The panel puts the estimate and the full repricing side by side for a 200 basis point rise in the yield. Which of the two shows the larger loss?
What does the tool print beside the estimate, and why is that the point?
Every calculator of this kind returns an estimate. The calculator here returns the estimate, then discounts all ten payments again at the new yield, and prints the difference between the two.
Work the default. The move is a 200 basis point rise in the yield, so the new yield is 10.50 per cent a year. The modified duration line multiplies 6.5613 by two percentage points, calls the price change minus 13.123 per cent, and puts the bond at Rs 868.7730/-. The full repricingDiscounting every one of the bond's payments again at the new yield and adding them, rather than estimating the change from a sensitivity figure. discounts Rs 85.00/- nine times and Rs 1,085.00/- once at 10.50 per cent a year and gets Rs 879.7045/-, which is minus 12.030 per cent. The printed gap is Rs 10.9315/-, or 1.093 percentage points, and the estimate is on the pessimistic side.
Now run the same default for a 200 basis point fall in the yield, so the new yield is 6.50 per cent a year. The modified duration line offers exactly the same 13.123 per cent, this time as a gain, and puts the bond at Rs 1,131.2270/-. The full repricing gets Rs 1,143.7766/-, a gain of 14.378 per cent. The gap is Rs 12.5496/-, or 1.255 percentage points, and now the estimate is on the low side.
The sign of that gap is the same on both sides, and that is the finding the second output exists to deliver. Wherever the yield ends up, the repriced bond lands above the line rather than on it, so a rise in the yield gives back a loss that is too large and a fall in the yield gives back a gain that is too small. The estimate is not merely imprecise. The estimate leans, and it leans the same way every time. A reader who has seen the lean once can correct for it in their head, and a reader who has not cannot.
The panel above prints a third price between those two. With the curvature term added to the straight line, the estimate moves from Rs 868.7730/- to Rs 880.4671/-, against a repricing of Rs 879.7045/-. The curvature term accounts for 93.0 per cent of the Rs 10.9315/- error and leaves Rs 0.7625/- behind, so convexity corrects the lean without closing it. What is left over is a remainder neither measure reaches, and unlike the duration error it does not lean one way: the repricing lands below the corrected estimate on a rise in the yield and above it on a fall.
Drive the move and watch the error rather than the price. Doubling the move from 25 to 50 basis points multiplies the straight line error by 3.9659, and doubling it from 200 to 400 multiplies it by 3.7503. The error grows close to four times for every doubling of the move, easing off as the move gets large. The size of the move rather than the bond decides whether the straight line is usable. Nothing in the modified duration on its own says where that crossover sits, which is why the panel prints the error in rupees rather than leaving anyone to judge it.
| Dmod | the modified duration, 6.5613 here, carried at full precision inside the tool |
| Δy | the yield move as a decimal, so 200 basis points is 0.02 |
| P | the starting price, Rs 1,000.00/- here |
| Pnew | the price after discounting every payment again at the new yield, on annual compounding |
| G | the gap, Rs 10.9315/- on a 200 basis point rise in the yield here |
Move the yield. Watch a gap that is invisible at 25 basis points open up at 400.
One control, running from a 400 basis point fall to a 400 basis point rise. The top pair of bars prices the ten year bullet bond two ways. The bottom pair is the gap for each of the two bonds, on a magnifying scale that rescales itself so the small end of the range stays visible.
For a rise of 200 basis points, the modified duration estimate puts the ten year bullet bond at Rs 868.7730/- and repricing puts it at Rs 879.7045/-, a difference of Rs 10.9315/-, and the estimate is on the pessimistic side.
With the move set to 25 basis points, is the magnified gap bar worth reading in rupees?
The panel returns a duration only estimate of Rs 868.7730/-, a convexity corrected estimate of Rs 880.4671/- and an exact repricing of Rs 879.7045/-. What has the correction done to the error?
What does the same tool return on a different schedule?
The second worked set, and it is the reason this calculator carries two bonds rather than one. The zero coupon bond is a single payment of Rs 1,000.00/- arriving at the ten year bullet bond's Macaulay duration, discounted at the same 8.50 per cent a year on annual compounding.
The tool returns a price of Rs 559.47/-, a Macaulay duration equal to its own maturity, a modified duration of 6.5613 and a convexity of 49.0986. The modified duration is identical to the bullet's, and that is forced arithmetic rather than a coincidence: the zero's maturity was set equal to the bullet's Macaulay duration, a zero coupon bondOne that pays nothing at all until maturity, when the face amount arrives as the only payment. has a Macaulay duration equal to its maturity, and both are divided by the same 1.085. Two schedules with nothing in common are made to agree on one output by construction.
Then run the moves. On a 200 basis point rise the bullet bondOne that pays interest along the way and returns the whole face amount in a single lump at the end. falls 12.030 per cent and the zero 12.193; on a 200 basis point fall the bullet gains 14.378 per cent and the zero 14.162. Same modified duration in, different moves out in both directions, and nothing in the shared 6.5613 says which bond is which.
A precision note on the two printed prices
The zero coupon bond’s maturity is the bullet’s Macaulay duration. That maturity reads 7.1191 years to four places and 7.11906264 in full, and the two do not discount to the same price. In full the payment discounts to Rs 559.4657/-, printed above as Rs 559.47/-. From the four place version it is Rs 559.4640/-, rounding to Rs 559.46/-. About a sixth of a paisa separates them on Rs 1,000.00/- of face, and the same substitution shifts the curvature figure from 49.0986 to 49.0991. Neither is wrong, and a reader who lands one paisa away now knows why.
The caveat that rides with this pair, printed here rather than parked below
Notice that one yield of 8.50 per cent a year was fed to both instruments. The shared yield is an artefact of how the pair was built, and it makes the bullet bond’s extra curvature look as though it arrived for nothing. Outside an invented pair, curvature is wanted, and anything wanted has a cost attached to it. An instrument carrying more of it tends to change hands on a thinner yield, and no cost of that kind is available anywhere in the figures worked here. So the four repricings above describe how two invented schedules behave and carry no view on which of the two belongs in anybody's hands.
The tool prints the zero coupon bond's price as Rs 559.46/- where Rs 559.47/- was expected. What happened?
What can this tool not compute, whatever is entered into it?
Five things, and naming them is not modesty. Each one is a boundary that can be walked into without complaint. A number comes back either way.
The calculator cannot handle a payment schedule that changes when the yield changes. The schedule goes in as given, and every output rests on it staying put. An instrument whose payments can be brought forward or pushed back when rates move breaks that assumption before the first present value is computed, and no amount of care with the four inputs repairs it.
The arithmetic cannot say whether the issuer pays. No field asks and no output depends on it, and both bonds here carry no credit element at all. Rate sensitivity is worked first where the only thing moving is the discount rate.
One yield is applied to every payment, and a single modified duration is defined on that assumption. The sensitivity cannot be split across separate points on a rate curve. Splitting it is covered separately.
Convexity can be measured here but not priced, and those are two different verbs. A more convex instrument is paid for, usually in a lower yield, and that cost sits in no figure worked here. Reading 58.4702 against 49.0986 as a reason to prefer one bond reads a measurement as a recommendation.
And it cannot say whether the move entered is likely. Likelihood is not an input and never becomes one, so a 25 basis point move and a 400 basis point move come back with the same arithmetic and no opinion attached to either.
The error that gets made, and what it actually costs
A reader runs the tool, reads the modified duration of 6.5613 and stops there. The reader now holds one number and treats it as the answer to how much the bond moves. It is not. The 6.5613 answers a different question: how much a straight line drawn at the current yield moves. The difference between the two answers is knowable.
On a 25 basis point move that difference is Rs 0.18/- on Rs 1,000.00/- of face and the habit forms harmlessly. On a 200 basis point move the line is out by Rs 10.9315/- on a rise in the yield and Rs 12.5496/- on a fall.
The cost is not the rupees. The damage is that the reader does not know the gap exists, so when a repriced figure disagrees with their estimate they go looking for a mistake in the repricing. That is exactly backwards, and it is the most expensive way to be wrong with a calculator: confidently, and in the direction of doubting the number that was right.
The fix is one line. Read the second output every time, and treat a gap of zero as a signal that the move was too small to be interesting rather than as proof that the estimate was exact.
The gap comes out with the opposite sign to the one stated above. What is the first thing to check?
Who actually reaches for a tool like this, and for what
Three people, with three different questions, and only one of them wants the headline number.
The first is someone auditing a figure that arrived from somewhere else. A duration lands in a note or in a file and the only honest response is to reproduce it. An auditor holding the schedule, the price and the convention does not need the calculator at all: they build the four column table by hand, check that the weights add to one, and see whether they land on the same four decimal places. A duration figure that cannot be reproduced from the terms and the price is a number somebody typed, and this table is how an auditor finds out which of the two kinds is in hand.
The second is someone sizing a move rather than describing a bond. Somebody sizing a move accepts that the modified duration is a slope, and wants to know how far it can be leaned on before it misleads. For them the panel's last rung is the whole tool: at 25 basis points the line is worth Rs 0.18/- of error and at 400 basis points it is worth Rs 40.9967/-, so how big a move the line survives is a range rather than a rule.
The third is the person choosing the input in the first place, which is the least obvious use and the most valuable. Because the error grows faster than the move does, the move entered decides whether the estimate is usable at all, so the modelling choice is made before any output appears. A household estimating a taxi fare from the first kilometre's rate is in the same position: over two kilometres it is fine, over forty it is not, and nothing in the rate itself says where the crossover sits. The panel above says where the crossover sits, in rupees, for this bond.
None of the three is choosing a bond. One instrument beating another in both directions reads like a recommendation to a skimming reader, and it is not one. Every comparison here is between measurements of two invented instruments, not between holdings.
Where the rules on any of this actually live
Five rule set items are touched by the arithmetic above. Each is a row here naming the authority that sets it. Each of them moves, so the current text is held at the source named beside the row.
| The item | Who sets it | Written out here |
|---|---|---|
| The valuation norms a regulated holder must value a bond against | Reserve Bank of India, rbi.org.in | Not filled in |
| Which curve that holder values against, and how the curve is put together | Reserve Bank of India, rbi.org.in | Not filled in |
| The compounding and day count conventions that attach to a given instrument | Reserve Bank of India, rbi.org.in, for government securities; SEBI, sebi.gov.in, for corporate debt | Not filled in |
| What a regulated pooled vehicle must disclose about the duration it carries | SEBI, sebi.gov.in | Not filled in |
| How a sensitivity figure must be computed for a regulatory return | Reserve Bank of India, rbi.org.in, or SEBI, sebi.gov.in, depending on the holder | Not filled in |
The arithmetic above is written free of any jurisdiction, so a second market becomes an addition to this table.
References
| Source | What it was named for | Site |
|---|---|---|
| Reserve Bank of India | The valuation norms a regulated holder values a bond against, the reference curve used for that, and the conventions attaching to a government security | rbi.org.in |
| SEBI | What a regulated pooled vehicle discloses about the duration it carries, and how a sensitivity figure is computed for a regulatory return | sebi.gov.in |
| Repository of academic working papers | The route taken before any named academic result is written down. None is named above, because the arithmetic here needs none | ideas.repec.org |
The ten year bullet bond and the zero coupon bond are invented.
Educational material. Not advice on any investment, tax, budget or market position.
