bond {FinancialMath}R Documentation

Bond Analysis

Description

Solves for the price, premium/discount, and Durations and Convexities (in terms of periods). At a specified period (t), it solves for the full and clean prices, and the write up/down amount. Also has the option to plot the convexity of the bond.

Usage

bond(f,r,c,n,i,ic=1,cf=1,t=NA,plot=FALSE)

Arguments

f

face value

r

coupon rate convertible cf times per year

c

redemption value

n

the number of coupons/periods for the bond

i

nominal interest rate convertible ic times per year

ic

interest conversion frequency per year

cf

coupon frequency- number of coupons per year

t

specified period for which the price and write up/down amount is solved for, if not NA

plot

tells whether or not to plot the convexity

Details

Effective Rate of Interest: eff.i=(1+iic)ic1eff.i=(1+\frac{i}{ic})^{ic}-1

j=(1+eff.i)1cf1j=(1+eff.i)^{\frac{1}{cf}}-1

coupon =frcf=\frac{f*r}{cf} (per period)

price = couponan ⁣j+c(1+j)n*{a_{\left. {\overline {\, n \,}}\! \right |j}}+c*(1+j)^{-n}

MACD=k=1nk(1+j)kcoupon+n(1+j)ncpriceMAC D=\frac{\sum_{k=1}^n k*(1+j)^{-k}*coupon+n*(1+j)^{-n}*c}{price}

MODD=k=1nk(1+j)(k+1)coupon+n(1+j)(n+1)cpriceMOD D=\frac{\sum_{k=1}^n k*(1+j)^{-(k+1)}*coupon+n*(1+j)^{-(n+1)}*c}{price}

MACC=k=1nk2(1+j)kcoupon+n2(1+j)ncpriceMAC C=\frac{\sum_{k=1}^n k^2*(1+j)^{-k}*coupon+n^2*(1+j)^{-n}*c}{price}

MODC=k=1nk(k+1)(1+j)(k+2)coupon+n(n+1)(1+j)(n+2)cpriceMOD C=\frac{\sum_{k=1}^n k*(k+1)*(1+j)^{-(k+2)}*coupon+n*(n+1)*(1+j)^{-(n+2)}*c}{price}

Price (for period t):

If t is an integer: price =couponant ⁣j+c(1+j)(nt)*{a_{\left. {\overline {\, n-t \,}}\! \right |j}}+c*(1+j)^{-(n-t)}

If t is not an integer then t=t+kt=t^*+k where tt^* is an integer and 0<k<10<k<1:

full price =(=( couponant ⁣j+c(1+j)(nt))(1+j)k*{a_{\left. {\overline {\, n-t^* \,}}\! \right |j}}+c*(1+j)^{-(n-t^*)})*(1+j)^k

clean price = full pricek-k*coupon

If price > c :

premium = pricec-c

Write-down amount (for period t) =(=(couponcj)(1+j)(nt+1)-c*j)*(1+j)^{-(n-t+1)}

If price < c :

discount =c=c-price

Write-up amount (for period t) =(cj=(c*j-coupon)(1+j)(nt+1))*(1+j)^{-(n-t+1)}

Value

A matrix of all of the bond details and calculated variables.

Note

t must be less than n.

To make the duration in terms of years, divide it by cf.

To make the convexity in terms of years, divide it by cf2cf^2.

Examples

bond(f=100,r=.04,c=100,n=20,i=.04,ic=1,cf=1,t=1)

bond(f=100,r=.05,c=110,n=10,i=.06,ic=1,cf=2,t=5)

[Package FinancialMath version 0.1.1 Index]