RQuantLib DiscountCurve failed when settleDate and Holiday

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

RQuantLib DiscountCurve failed when settleDate and Holiday

Charles Duranceau
I'm working with the Discount Curve function found a case where the bootstrap failed when

Error message: Error: 1st iteration: failed at 1st alive instrument, pillar October 4th, 2017, maturity October 4th, 2017, reference date July 5th, 2017: negative time (-0.00273973) given

a)      Using a settlement date in parameter (t+2) and

b)      there's holiday.

I present below a reproducible example.

I would like to know if this is normal and how should I use the "settleDate "correctly.
Thank you
Bets Regards

Reproducible case


tsQuotes <- list(d3m = 0.0363,
                 s2y = 0.037125,
                 s3y = 0.0398,
                 s5y = 0.0443,
                 s10y = 0.05165,
                 s15y = 0.055175)
times <- c(0.25,0.5,0.75,1,2,3,5,10,14.75)

dateSett<-advance(calendar="UnitedStates/Settlement", dateValue, 2,0) # fall on the 5th this is correct as the 4th is holiday

DiscountCurve(params,tsQuotes,times,legparam)  # does not works

> sessionInfo()

R version 3.3.2 (2016-10-31)

Platform: x86_64-w64-mingw32/x64 (64-bit)

Running under: Windows >= 8 x64 (build 9200)


[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252

[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252

attached base packages:

[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:

[1] RQuantLib_0.4.3

loaded via a namespace (and not attached):

 [1] zoo_1.7-12       lazyeval_0.2.0   magrittr_1.5     R6_2.1.2         assertthat_0.2.0 DBI_0.6-1        tools_3.3.2      tibble_1.3.3

 [9] Rcpp_0.12.10     stringi_1.1.5    grid_3.3.2       rlang_0.1.1      lattice_0.20-34

        [[alternative HTML version deleted]]

[hidden email] mailing list
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.