Skip to content

BondValuation

Fixed Coupon Bond Valuation Allowing for Odd Coupon Periods and Various Day Count Conventions

v0.1.1 · May 28, 2022 · GPL-3

Description

Analysis of large datasets of fixed coupon bonds, allowing for irregular first and last coupon periods and various day count conventions. With this package you can compute the yield to maturity, the modified and MacAulay durations and the convexity of fixed-rate bonds. It provides the function AnnivDates, which can be used to evaluate the quality of the data and return time-invariant properties and temporal structure of a bond.

Downloads

331

Last 30 days

11746th

792

Last 90 days

3.1K

Last year

Trend: +27.3% (30d vs prior 30d)

CRAN Check Status

3 ERROR
11 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 ERROR
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 ERROR
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 ERROR
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (3 non-OK)
ERROR r-devel-macos-arm64

examples

Running examples in ‘BondValuation-Ex.R’ failed
The error most likely occurred in:

> ### Name: AnnivDates
> ### Title: AnnivDates (time-invariant properties and temporal structure)
> ### Aliases: AnnivDates
> 
> ### ** Examples
> 
> data(SomeBonds2016)
> 
> # Applying the function AnnivDates to the data frame SomeBonds2016.
> system.time(
+   FullAnalysis<-apply(SomeBonds2016[,c('Issue.Date','Mat.Date','CpY.Input','FIPD.Input',
+   'LIPD.Input','FIAD.Input','RV.Input','Coup.Input','DCC.Input','EOM.Input')],1,function(y)
+   AnnivDates(y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],RegCF.equal=1)),
+ gcFirst = TRUE)
Warning in InputFormatCheck(Em = Em, Mat = Mat, CpY = CpY, FIPD = FIPD,  :
  The issue date (Em) is supplied as a string of class "character" in the format "yyyy-mm-dd". It is converted to class "Date" using the command "as.Date(Em,"%Y-%m-%d")" and processed as Em = 2016-03-24 .
Warning in InputFormatCheck(Em = Em, Mat = Mat, CpY = CpY, FIPD = FIPD,  :
  The maturity da
...[truncated]...
  Its conversion to class numeric results in EOM = 1 .
Warning in AnnivDates(y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8], y[9],  :
  The provided EOM = 1 conflicts with one or several provided calendar dates.
                              EOM is set 0 .
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 20 >= vector size 20)
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 21 >= vector size 20)
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 20 >= vector size 20)
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 21 >= vector size 20)
Error in if (index_LIPD >= 1) { : argument is of length zero
Calls: system.time -> apply -> FUN -> AnnivDates
Timing stopped at: 0.006 0.001 0.007
Execution halted
ERROR r-oldrel-macos-arm64

examples

Running examples in ‘BondValuation-Ex.R’ failed
The error most likely occurred in:

> ### Name: AnnivDates
> ### Title: AnnivDates (time-invariant properties and temporal structure)
> ### Aliases: AnnivDates
> 
> ### ** Examples
> 
> data(SomeBonds2016)
> 
> # Applying the function AnnivDates to the data frame SomeBonds2016.
> system.time(
+   FullAnalysis<-apply(SomeBonds2016[,c('Issue.Date','Mat.Date','CpY.Input','FIPD.Input',
+   'LIPD.Input','FIAD.Input','RV.Input','Coup.Input','DCC.Input','EOM.Input')],1,function(y)
+   AnnivDates(y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],RegCF.equal=1)),
+ gcFirst = TRUE)
Warning in InputFormatCheck(Em = Em, Mat = Mat, CpY = CpY, FIPD = FIPD,  :
  The issue date (Em) is supplied as a string of class "character" in the format "yyyy-mm-dd". It is converted to class "Date" using the command "as.Date(Em,"%Y-%m-%d")" and processed as Em = 2016-03-24 .
Warning in InputFormatCheck(Em = Em, Mat = Mat, CpY = CpY, FIPD = FIPD,  :
  The maturity da
...[truncated]...
  Its conversion to class numeric results in EOM = 1 .
Warning in AnnivDates(y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8], y[9],  :
  The provided EOM = 1 conflicts with one or several provided calendar dates.
                              EOM is set 0 .
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 20 >= vector size 20)
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 21 >= vector size 20)
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 20 >= vector size 20)
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 21 >= vector size 20)
Error in if (index_LIPD >= 1) { : argument is of length zero
Calls: system.time -> apply -> FUN -> AnnivDates
Timing stopped at: 0.012 0.001 0.014
Execution halted
ERROR r-release-macos-arm64

examples

Running examples in ‘BondValuation-Ex.R’ failed
The error most likely occurred in:

> ### Name: AnnivDates
> ### Title: AnnivDates (time-invariant properties and temporal structure)
> ### Aliases: AnnivDates
> 
> ### ** Examples
> 
> data(SomeBonds2016)
> 
> # Applying the function AnnivDates to the data frame SomeBonds2016.
> system.time(
+   FullAnalysis<-apply(SomeBonds2016[,c('Issue.Date','Mat.Date','CpY.Input','FIPD.Input',
+   'LIPD.Input','FIAD.Input','RV.Input','Coup.Input','DCC.Input','EOM.Input')],1,function(y)
+   AnnivDates(y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],RegCF.equal=1)),
+ gcFirst = TRUE)
Warning in InputFormatCheck(Em = Em, Mat = Mat, CpY = CpY, FIPD = FIPD,  :
  The issue date (Em) is supplied as a string of class "character" in the format "yyyy-mm-dd". It is converted to class "Date" using the command "as.Date(Em,"%Y-%m-%d")" and processed as Em = 2016-03-24 .
Warning in InputFormatCheck(Em = Em, Mat = Mat, CpY = CpY, FIPD = FIPD,  :
  The maturity da
...[truncated]...
  Its conversion to class numeric results in EOM = 1 .
Warning in AnnivDates(y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8], y[9],  :
  The provided EOM = 1 conflicts with one or several provided calendar dates.
                              EOM is set 0 .
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 20 >= vector size 20)
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 21 >= vector size 20)
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 20 >= vector size 20)
Warning in DIST(c(DCC, Atom1AD_PreFin, Atom2AD_PreFin, Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 21 >= vector size 20)
Error in if (index_LIPD >= 1) { : argument is of length zero
Calls: system.time -> apply -> FUN -> AnnivDates
Timing stopped at: 0.008 0.001 0.008
Execution halted

Check History

ERROR 11 OK · 0 NOTE · 0 WARNING · 3 ERROR · 0 FAILURE Mar 10, 2026
ERROR r-devel-macos-arm64

examples

Running examples in ‘BondValuation-Ex.R’ failed
The error most likely occurred in:

> ### Name: AnnivDates
> ### Title: AnnivDates (time-invariant properties and temporal structure)
> ### Aliases: AnnivDates
> 
> ### ** Examples
> 
> data(SomeBonds20
...[truncated]...
 Atom3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 21 >= vector size 20)
Error in if (index_LIPD >= 1) { : argument is of length zero
Calls: system.time -> apply -> FUN -> AnnivDates
Timing stopped at: 0.005 0 0.006
Execution halted
ERROR r-release-macos-arm64

examples

Running examples in ‘BondValuation-Ex.R’ failed
The error most likely occurred in:

> ### Name: AnnivDates
> ### Title: AnnivDates (time-invariant properties and temporal structure)
> ### Aliases: AnnivDates
> 
> ### ** Examples
> 
> data(SomeBonds20
...[truncated]...
m3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 21 >= vector size 20)
Error in if (index_LIPD >= 1) { : argument is of length zero
Calls: system.time -> apply -> FUN -> AnnivDates
Timing stopped at: 0.008 0.001 0.008
Execution halted
ERROR r-oldrel-macos-arm64

examples

Running examples in ‘BondValuation-Ex.R’ failed
The error most likely occurred in:

> ### Name: AnnivDates
> ### Title: AnnivDates (time-invariant properties and temporal structure)
> ### Aliases: AnnivDates
> 
> ### ** Examples
> 
> data(SomeBonds20
...[truncated]...
m3AD_PreFin, Atom1AD_PreFin,  :
  subscript out of bounds (index 21 >= vector size 20)
Error in if (index_LIPD >= 1) { : argument is of length zero
Calls: system.time -> apply -> FUN -> AnnivDates
Timing stopped at: 0.012 0.001 0.014
Execution halted

Reverse Dependencies (1)

suggests

Dependency Network

Dependencies Reverse dependencies Rcpp timeDate ragtop BondValuation

Version History

new 0.1.1 Mar 10, 2026
updated 0.1.1 ← 0.1.0 diff May 27, 2022
new 0.1.0 Nov 13, 2018