# NOT RUN {
##These examples approximately replicate the Crude Oil data utilized within the
##prominent work of Schwartz and Smith (2000):
###Method 1 - Stitch crude oil contracts according to maturity matching:
SS_stitched_M1 <- stitch_contracts(futures = SS_oil$contracts,
futures_TTM = c(1, 5, 9, 13, 17)/12,
maturity_matrix = SS_oil$contract_maturities,
rollover_frequency = 1/12, verbose = TRUE)
###Method 2 - Stitch crude oil contracts according to nearest contract numbers:
SS_stitched_M2 <- stitch_contracts(futures = SS_oil$contracts,
contract_numbers = c(1, 5, 9, 13, 17), verbose = TRUE)
# }
Run the code above in your browser using DataLab