##
# Example usage
# Face value = 1,000 currency units
# Coupon rate = 8%
# Yield to maturity = 8%
# Maturity = 6 years
example <- fis(
FV = 1000, # Bond with face value of 1.000 currency units
CR = 0.08, # 8% Coupon rate
YTM = 0.08, # 8% Yield to maturity
MAT = 6 # 6 periods to maturity
)
print(example)
# Face value = 1,000 currency units
# Coupon rate = 8%
# Yield to maturity = 12%
# Maturity = 2 years
# Coupons pay semi-annually
example2 <- fis(
FV = 1000, # Bond with face value of 1.000 currency units
CR = 0.08, # 8% Coupon rate
YTM = 0.12, # 8% Yield to maturity
MAT = 2, # 6 periods to maturity
SEMI = TRUE
)
print(example2)
Run the code above in your browser using DataLab