# Bond Mathematics Formulas

FORMULA 1-A compounding 

F1A:FV=PV*(1+r/Times)^(n*Times);

FORMULA 1-B discount factor

F1B: df=1.0/(1+r/Times)^(n*Times);

FORMULA 1-C modified duration

F1C1: Dm=(-1./PV)*'diff(PV, r);

F1C2:  Dm=(-1./PV)*dPV/dr;

FORMULA 1-D  Macaulay duration

F1D: DMAC=(1.0+r/Times)*Dm;

FORMULA 1-E  convexity

F1E: Cv='diff('diff(PV, r), r)/PV;

FORMULA 1-F  rate of price change

F1F1: rpc=-Dm*dr;

F1F2: rpc=-Dm*dr+Cv*(dr)^2/2;

F1F3: rpc=dPV/PV;

FORMULA 1-G  return

F1G: Return=(PV_1-PV_0)/PV_0;

FORMULA 2  bond price

F2: PV=nusum(c*F/cTimes/(1+r/Times)^(i*Times/cTimes), i, 1, N*cTimes)
+F/(1+r/Times)^(N*Times);

FORMULA 3  morgage, annuity

F3A: PV=nusum(rvalue/(1+r/Times)^(i*Times/rTimes), i, 1, N*rTimes);

F3B: PV=nusum(avalue/(1+r/Times)^(i*Times/aTimes), i, 1, N*aTimes);

FORMULA 4-A  Immunization(2 bonds)

F4A1: [x1*PV1+x2*PV2=PVd, x1*PV1*DMAC1+x2*PV2*DMAC2=PVd*DMACd];

F4A2: DMACP=(x1*PV1*DMAC1+x2*PV2*DMAC2)/(x1*PV1+x2*PV2);

F4A3: CvP=(x1*PV1*Cv1+x2*PV2*Cv2)/(x1*PV1+x2*PV2);

FORMULA 4-B  Immunization(3 bonds)

F4B1: [x1*PV1+x2*PV2+x3*PV3=PVd,
    x1*PV1*DMAC1+x2*PV2*DMAC2+x3*PV3*DMAC3=PVd*DMACd,
    x1*PV1*Cv1+x2*PV2*Cv2+x3*PV3*Cv3=PVd*Cvd ];

F4B2: DMACP=(x1*PV1*DMAC1+x2*PV2*DMAC2+x3*PV3*DMAC3)/
    (x1*PV1+x2*PV2+x3*PV3);

F4B3: CvP=(x1*PV1*Cv1+x2*PV2*Cv2+x3*PV3*Cv3)/
    (x1*PV1+x2*PV2+x3*PV3);

Legal Notice: The copyright for this application is owned by the authors.
The authors are not responsible for any errors contained within and are not liable
for any damages resulting from the use of this material.
This application is intended for non-commercial, non-profit use only.
Contact the authors for permission if you wish to use this application in for-profit activities.
Contact address: Prof. Yukari Shirota, Faculty of Economics, Gakushuin University, 1-5-1 Mejiro,
Toshima-ku, Tokyo, 171-8588 JAPAN,  yukari.shirota@ipsj.or.jp