[Rquantlib-commits] r278 - in pkg/RQuantLib: R tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Aug 2 19:09:00 CEST 2010
Author: edd
Date: 2010-08-02 19:08:59 +0200 (Mon, 02 Aug 2010)
New Revision: 278
Modified:
pkg/RQuantLib/R/calendars.R
pkg/RQuantLib/tests/RQuantlib.Rout.save
Log:
corrected arguments for deprecated BusinessDay function (we now prefer isBusinessDay)
update regression testing output for fact that we longer return lists for single argument returns under the new API
Modified: pkg/RQuantLib/R/calendars.R
===================================================================
--- pkg/RQuantLib/R/calendars.R 2010-08-02 16:45:46 UTC (rev 277)
+++ pkg/RQuantLib/R/calendars.R 2010-08-02 17:08:59 UTC (rev 278)
@@ -29,7 +29,9 @@
names(val) <- dates
val
}
-businessDay <- function(...) isBusinessDay(...) ## may get deprecated one day
+businessDay <- function(calendar="TARGET", dates=Sys.Date()) { ## may get deprecated one day
+ isBusinessDay(calendar, dates)
+}
isHoliday <- function(calendar="TARGET", dates=Sys.Date()) {
stopifnot(is.character(calendar))
Modified: pkg/RQuantLib/tests/RQuantlib.Rout.save
===================================================================
--- pkg/RQuantLib/tests/RQuantlib.Rout.save 2010-08-02 16:45:46 UTC (rev 277)
+++ pkg/RQuantLib/tests/RQuantlib.Rout.save 2010-08-02 17:08:59 UTC (rev 278)
@@ -151,33 +151,25 @@
>
> ## bond.cpp: examples from Fixed Income page of Matlab
> ZeroYield(95, 100, as.Date("1993-6-24"), as.Date("1993-11-1"))
-$yield
[1] 0.1477733
-
attr(,"class")
[1] "ZeroYield"
>
> ## bond.cpp: test theoretical price of bond by its yield
> ZeroPriceByYield(0.1478, 100, as.Date("1993-6-24"), as.Date("1993-11-1"))
-$cleanPrice
[1] 94.99914
-
attr(,"class")
[1] "ZeroPriceByYield"
>
> ## bond.cpp: test theoretical yield of a fixed rate bond, = 0.0307
> FixedRateBondYield(,99.282, 100000, as.Date("2004-11-30"), as.Date("2008-11-30"), 3, , c(0.02875), , , , ,as.Date("2004-11-30"))
-$yield
[1] 0.03066526
-
attr(,"class")
[1] "FixedRateBondYield"
>
> ## bond.cpp: test theoretical price of a fixed rate bond = 99.2708
> FixedRateBondPriceByYield(,0.0307, 100000, as.Date("2004-11-30"), as.Date("2008-11-30"), 3, , c(0.02875), , , , ,as.Date("2004-11-30"))
-$cleanPrice
[1] 99.26903
-
attr(,"class")
[1] "FixedRateBondPriceByYield"
>
More information about the Rquantlib-commits
mailing list