The following warnings occurred:
Warning [2] Undefined array key 13381 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 13432 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 13442 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 13446 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 14015 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 14041 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 14042 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 14054 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 14077 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 14196 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 13442 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 14196 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 14042 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





17Bii - Bond Duration



#11

I don't know if this has been discussed on this message board before, but I am trying to figure out how to calculate Macauly and Modified duration using "solve". Does anybody else know of or have a formula that they have developed on their own calculator that they would like to share?


#12

Brian:

Sorry for the late reply, but I didn't want to contribute when all I could say is "no!"

Can you provide the relevant equations/methodology? If so, I'm sure somebody here could help you with your problem. I love programming the 17BII and 19BII, so I would take a whack at it for you if it is not too big a project.

If I misunderstood your post, in that you don't know the relevant equations, then unfortunately I can't be of any help there.

Bruce.


#13

I guess you are considering a fixed rate bond, so I'll try to explain you how I solved this problem.

First what I suggest to you is to set-up a STAT list named, for example CF (cash flows, in which you'll put the single cash flows for each coupon period (annual, semi-annual, ...). The last cash flow should be the last coupon plus the face value of the bond.

You can then calculate the bond duration by solving the following related equations:

1. bond price

Calculates the bond price for a given yield to maturity or vice-versa.

2. duration

Calculates the bond duration for the ytm calculated in equation 1

3. price sensitivity

Calculates the price change for a given movement in rates

4. convexity

calculates the convexity of the bond specified above

5. exact price sensitivity

calculates the exact price change, using the convexity adjustment for the bond durtation calculated in equation 3.

If you want I can e-mail the program codes.

By

#14

Duration = [(1 + a) / a] - [(1 + a) + yrs * (i - a)] / [i * [(1 + a) ^yrs - 1] + i]

Where:

a = yield to maturity
i = annual interest (coupon)
yrs = the number of years to maturity

So, for a bond of 10 years to maturity with a 10% annual coupon presently yielding 8%, the duration is

[(1 + 0.1)/ 0.1] - [(1 + 0.1) + 10 x (0.1-0.08)] / [0.1 x [(1+0.1)^10 - 1 ] + 0.1]

or

[11 - [ 1.1 +0.2] / [0.1 x [1.593742] + 0.1]

or

[11 - 1.3/(0.2593742)]

or

5.9879 years

Gene
P.S. I'll be in NY, Chicago, and SF the first 3 weeks of February giving time value of money talks for a CFA exam review course, if anyone here is taking it. :-)


#15

I'm a CFP student so this equation is of interest to me. I beleive there is at least one, possibly multiple, errors in
this post. When I do the calculation using my preprogrammed
SOLVE formula on my HP17BII I get 6.9658 (this SOLVE formula
gives correct results as per CFP course exams given by the College of Financial Planning). If I'm not mistaken, the
substitutions of values into the equation in this post have
not been done correctly. According to the substitutions, the variable "a" is .1 or .08 depending on where in the
formula you look. Also, the formula should end in "+ a" not
"+ i".

I'd like to hear back if I am mistaken about my observations
since I'm studying this equation for a comprehensive
certification exam.

Kay


#16

http://www.finplan.com/invest/bondduration.asp

The link above is where I got the formula. I think I typed it in correctly. Of course, the formula may be wrong on the web page.

You are, however, quite right that I substituted the values into the formula incorrectly. My fault!

Here is another site with a specific duration calculation example:

http://invest-faq.com/articles/bonds-duration.html

Gene Wright
CFA Exam Test Reviewer
http://www.amazon.com/exec/obidos/ASIN/1888840196/
http://members.aol.com/hpgene

#17

You did type the formula into your post correctly. I checked out the web site you noted. The formula is wrong there too. I sent them an e-mail to notify them of the mistake. Hopefully they'll fix it. I've double and triple checked this against my CFP student materials and the only way my observation could be wrong is if the student materials are.

Thanks,
Kay


#18

Hi,

if anyone of you is still looking for a bond duration formula, I did spend some hours and programmed one myself on my 17bii -- doing it the "old-fashioned" way.

It might not be the shortest one, but I think it works. It also uses some built-in formulas.

O.K. here it is:
(Note: SUM is the built-in sum-function (ALPHA-Menu -> WXYZ -> OTHER -> MORE -> SUM (second from the
left)))

DURTN=(SUM(I:1:N*F:1:I/F*C%/100/F*SPPV(R%/F:I))+N*SPPV(R%/F:N*F))/(C%/100/F*USPV(R%/F:N*F)+SPPV(R%/F:N*F))

Where
C% ... Coupon (e.g. 7)
R% ... YTM (e.g. 6)
F ... payment frequency (e.g. Semi-annually -> 2, annually -> 1)
N ... Years

Example:
A 3 (N=3) Year semi-annual (F=2) coupon bond with a coupon of 6% (C%=6) and YTM of 7% p.a. (R%=7) has a (macaulay) duration of 2.79 yrs.

Hope this it what you are looking for.

Michael

#19

Here is the formula I have programmed into my HP17BII to
solve for modified Duration - I'm a CFP student.

DURTN: ((1+(Y x .01) / PYR) / ((Y x .01)/PYR) - (((1+(Y x .01) / PYR) + ((N x PYR) x ((C x .01)/PYR - (Y x .01) / PYR))) / ((C x .01) / PYR x ((1+(Y x .01) / PYR)^(N x PYR) -1) + (Y x .01) / PYR))) / PYR = DURTN

where
Y is yield to maturity
N is number of years to maturity
C is coupon
PYR is the number of compounding periods per year (1 or 2).

Note that all variable values are entered as whole numbers including Y and C.

This formula reduces calculating duration on the
HP17BII to as few as 11 keystrokes. I don't claim that this
is the shortest formula possible...but it works.

I also have a formula for bond price change calculations
that will calculate either $ or %. let me know if you are
interested in this.
Kay


#20

Correction - my SOLVE equation doesn't calculate modified duration, just plain old duration. My bond price change
formula does the "modfied" part.
Kay


Possibly Related Threads…
Thread Author Replies Views Last Post
  17BII & 17BII+ Discounted Payback Period Revisited Tom Neudorfl 8 2,817 11-25-2013, 10:28 AM
Last Post: Don Shepherd
  Bond duration and convexity Santiago Estevez 1 1,260 04-05-2013, 05:32 PM
Last Post: BruceH
  Kitchen timer on 17B/17BII/17BII+/19B/19BII/27S y.miyata 1 1,032 03-04-2010, 12:18 PM
Last Post: Martin Pinckney
  Modified Duration on 17bII+ Patrick Landry 1 978 09-10-2007, 06:48 PM
Last Post: Peter A. Gebhardt
  Duration Formula / HP 49g+ Thomas 3 1,251 09-05-2006, 08:41 AM
Last Post: Katie Wasserman
  Battery pack hp41 duration Calc 0 677 12-21-2005, 06:38 PM
Last Post: Calc
  Normal Distribution and Black-Scholes for HP 17B, 17BII, NEW 17BII+, 19B, 19BII Bob Wang 0 895 09-24-2004, 02:25 PM
Last Post: Bob Wang
  17BII: Bond yields different from NYT tables? Peter Lampione 0 676 05-19-2002, 02:59 AM
Last Post: Peter Lampione

Forum Jump: