我正在尝试使用指数样条拟合函数通过QuantLib构建美国国库曲线样条。但是,我得到的结果非常奇怪,无法弄清原因。即,从生成的折现曲线得出的负利率,其中输入均为正 yield ,前端 yield 存在巨大差异(下图)。
我正在向函数提供大于1Y的整个债券范围,这会导致某些重复的到期日(对于在不同时间发行的债券并向下滚动曲线),因此我不确定这是否会引起一些拟合问题。我正在使用的整个数据框(在代码中称为df)显示在底部。
这是我的代码,用于拟合曲线和下面的相应数据。 (“YrsToMat”列是由YrsToMat<- sapply(maturities, yearFraction, startDates = Sys.Date(), dayCounters = 9) #9 = ActualActual.Bond
生成的,其中maturities
是所有债券到期日的列表)。
谢谢你的帮助!
library(RQuantLib)
YrsToMat <- df$YrsToMat
marketQuotes <- df$Prices
cpn_rates <- df$Coupons
dateparams <- list(settlementDays=1, period="Semiannual",
dayCounter="ActualActual.Bond",
businessDayConvention ="ModifiedFollowing")
curveparams <- list(method="ExponentialSplinesFitting",
origDate = Sys.Date())
curve <- FittedBondCurve(curveparams, YrsToMat, cpn_rates, marketQuotes, dateparams)
structure(list(ISIN = structure(1:261, .Label = c("US912810EM63",
"US912810EN47", "US912810EP94", "US912810EQ77", "US912810ES34",
"US912810ET17", "US912810EV62", "US912810EW46", "US912810EX29",
"US912810EY02", "US912810EZ76", "US912810FA17", "US912810FB99",
"US912810FE39", "US912810FF04", "US912810FG86", "US912810FJ26",
"US912810FM54", "US912810FP85", "US912810FT08", "US912810PT97",
"US912810PU60", "US912810PW27", "US912810PX00", "US912810QA97",
"US912810QB70", "US912810QC53", "US912810QD37", "US912810QE10",
"US912810QH41", "US912810QK79", "US912810QL52", "US912810QN19",
"US912810QQ40", "US912810QS06", "US912810QT88", "US912810QU51",
"US912810QW18", "US912810QX90", "US912810QY73", "US912810QZ49",
"US912810RB61", "US912810RC45", "US912810RD28", "US912810RE01",
"US912810RG58", "US912810RH32", "US912810RJ97", "US912810RK60",
"US912810RM27", "US912810RN00", "US912810RP57", "US912810RQ31",
"US912810RS96", "US912810RT79", "US912810RU43", "US912810RV26",
"US912810RX81", "US912810RY64", "US912810RZ30", "US912810SA79",
"US912810SC36", "US912810SD19", "US912810SE91", "US912810SF66",
"US912810SH23", "US912810SJ88", "US912810SK51", "US912810SL35",
"US912810SN90", "US912810SP49", "US912810SQ22", "US912810SR05",
"US912810SS87", "US9128282A70", "US9128282D10", "US9128282N91",
"US9128282P40", "US9128282R06", "US9128282S88", "US9128282U35",
"US9128282W90", "US9128282Y56", "US9128283C28", "US9128283D01",
"US9128283F58", "US9128283J70", "US9128283P31", "US9128283U26",
"US9128283V09", "US9128283W81", "US9128283Z13", "US9128284A52",
"US9128284D91", "US9128284F40", "US9128284L18", "US9128284M90",
"US9128284N73", "US9128284R87", "US9128284S60", "US9128284U17",
"US9128284V99", "US9128284X55", "US9128284Z04", "US9128285C00",
"US9128285D82", "US9128285J52", "US9128285K26", "US9128285M81",
"US9128285N64", "US9128285P13", "US9128285R78", "US9128285T35",
"US9128285U08", "US9128285V80", "US9128285Z94", "US9128286A35",
"US9128286B18", "US9128286C90", "US9128286F22", "US9128286G05",
"US9128286H87", "US9128286L99", "US9128286M72", "US9128286R69",
"US9128286S43", "US9128286T26", "US9128286U98", "US9128286X38",
"US9128286Y11", "US9128286Z85", "US9128287B09", "US9128287C81",
"US912828B667", "US912828D564", "US912828G385", "US912828G534",
"US912828G872", "US912828H862", "US912828J272", "US912828J439",
"US912828J769", "US912828K742", "US912828L245", "US912828L575",
"US912828M490", "US912828M565", "US912828M805", "US912828N308",
"US912828P386", "US912828P469", "US912828P790", "US912828Q293",
"US912828R283", "US912828R366", "US912828R697", "US912828S356",
"US912828S927", "US912828SF82", "US912828SV33", "US912828T263",
"US912828T917", "US912828TJ95", "US912828TY62", "US912828U246",
"US912828U576", "US912828U659", "US912828U816", "US912828UN88",
"US912828V236", "US912828V723", "US912828V806", "US912828V988",
"US912828VB32", "US912828VS66", "US912828W481", "US912828W556",
"US912828W713", "US912828W895", "US912828WE61", "US912828WJ58",
"US912828WZ90", "US912828X471", "US912828X703", "US912828X885",
"US912828XB14", "US912828XD79", "US912828XG01", "US912828XQ82",
"US912828XR65", "US912828XT22", "US912828XW50", "US912828XX34",
"US912828XZ81", "US912828Y610", "US912828Y792", "US912828Y875",
"US912828Y958", "US912828YA22", "US912828YB05", "US912828YD60",
"US912828YE44", "US912828YF19", "US912828YG91", "US912828YH74",
"US912828YK04", "US912828YM69", "US912828YQ73", "US912828YS30",
"US912828YT13", "US912828YU85", "US912828YV68", "US912828YW42",
"US912828YX25", "US912828YY08", "US912828YZ72", "US912828Z294",
"US912828Z526", "US912828Z609", "US912828Z781", "US912828Z864",
"US912828Z948", "US912828ZA13", "US912828ZB95", "US912828ZC78",
"US912828ZD51", "US912828ZE35", "US912828ZF00", "US912828ZG82",
"US912828ZH65", "US912828ZL77", "US912828ZM50", "US912828ZN34",
"US912828ZP81", "US912828ZQ64", "US912828ZR48", "US912828ZS21",
"US912828ZT04", "US912828ZU76", "US912828ZV59", "US912828ZW33",
"US912828ZX16", "US912828ZY98", "US91282CAB72", "US91282CAC55",
"US91282CAD39", "US91282CAE12", "US91282CAF86", "US91282CAG69",
"US91282CAH43", "US91282CAJ09", "US91282CAK71", "US91282CAL54",
"US91282CAM38", "US91282CAN11", "US91282CAP68", "US91282CAR25",
"US91282CAT80", "US91282CAU53", "US91282CAV37", "US91282CAW10"
), class = "factor"), YrsToMat = c(1, 1, 1, 1.08333333333333,
1.08333333333333, 1.08333333333333, 1.08333333333333, 1.16666666666667,
1.16666666666667, 1.16666666666667, 1.16666666666667, 1.25, 1.25,
1.25, 1.25, 1.25, 1.33333333333333, 1.33333333333333, 1.33333333333333,
1.33333333333333, 1.41666666666667, 1.41666666666667, 1.41666666666667,
1.41666666666667, 1.5, 1.5, 1.5, 1.5, 1.5, 1.58333333333333,
1.58333333333333, 1.58333333333333, 1.58333333333333, 1.66666666666667,
1.66666666666667, 1.66666666666667, 1.66666666666667, 1.75, 1.75,
1.75, 1.75, 1.75, 1.75, 1.83333333333333, 1.83333333333333, 1.83333333333333,
1.83333333333333, 1.91666666666667, 1.91666666666667, 1.91666666666667,
1.91666666666667, 2, 2, 2, 2.08333333333333, 2.08333333333333,
2.16666666666667, 2.16666666666667, 2.16666666666667, 2.25, 2.25,
2.25, 2.25, 2.25, 2.33333333333333, 2.33333333333333, 2.33333333333333,
2.41666666666667, 2.41666666666667, 2.41666666666667, 2.5, 2.5,
2.5, 2.5, 2.58333333333333, 2.58333333333333, 2.58333333333333,
2.66666666666667, 2.66666666666667, 2.66666666666667, 2.75, 2.75,
2.75, 2.75, 2.75, 2.83333333333333, 2.83333333333333, 2.83333333333333,
2.91666666666667, 2.91666666666667, 2.91666666666667, 3, 3, 3,
3, 3.08333333333333, 3.08333333333333, 3.16666666666667, 3.16666666666667,
3.25, 3.25, 3.25, 3.33333333333333, 3.41666666666667, 3.41666666666667,
3.5, 3.5, 3.58333333333333, 3.58333333333333, 3.66666666666667,
3.66666666666667, 3.75, 3.75, 3.75, 3.83333333333333, 3.83333333333333,
3.91666666666667, 3.91666666666667, 4, 4, 4, 4, 4.08333333333333,
4.08333333333333, 4.16666666666667, 4.16666666666667, 4.25, 4.25,
4.25, 4.25, 4.33333333333333, 4.33333333333333, 4.41666666666667,
4.41666666666667, 4.5, 4.5, 4.5, 4.58333333333333, 4.58333333333333,
4.66666666666667, 4.66666666666667, 4.75, 4.75, 4.75, 4.75, 4.83333333333333,
4.83333333333333, 4.91666666666667, 4.91666666666667, 5, 5, 5.08333333333333,
5.16666666666667, 5.25, 5.25, 5.25, 5.33333333333333, 5.41666666666667,
5.5, 5.5, 5.58333333333333, 5.66666666666667, 5.75, 5.75, 5.75,
5.83333333333333, 5.91666666666667, 6, 6, 6, 6.08333333333333,
6.16666666666667, 6.25, 6.25, 6.25, 6.33333333333333, 6.41666666666667,
6.5, 6.5, 6.58333333333333, 6.66666666666667, 6.75, 6.75, 6.75,
6.83333333333333, 6.91666666666667, 7, 7, 7.25, 7.5, 7.75, 7.75,
8, 8, 8.25, 8.25, 8.5, 8.75, 8.75, 9, 9.25, 9.5, 9.5, 9.75, 10,
10.25, 15.25, 16.25, 16.5, 17.25, 17.5, 18.25, 18.5, 18.75, 19,
19.25, 19.5, 19.5, 19.75, 19.75, 20, 20.25, 20.5, 20.75, 21,
21.25, 21.5, 21.75, 22, 22.25, 22.5, 22.75, 23, 23.25, 23.5,
23.75, 24, 24.25, 24.5, 24.75, 25, 25.25, 25.5, 25.75, 26, 26.25,
26.5, 26.75, 27, 27.25, 27.5, 27.75, 28, 28.25, 28.5, 28.75,
29, 29.25, 29.5, 29.75, 30), Coupons = c(0.0725, 0.07625, 0.07125,
0.0625, 0.075, 0.07625, 0.06875, 0.06, 0.0675, 0.065, 0.06625,
0.06375, 0.06125, 0.055, 0.0525, 0.0525, 0.06125, 0.0625, 0.05375,
0.045, 0.0475, 0.05, 0.04375, 0.045, 0.035, 0.0425, 0.045, 0.04375,
0.04625, 0.04375, 0.03875, 0.0425, 0.0475, 0.04375, 0.0375, 0.03125,
0.03125, 0.03, 0.0275, 0.0275, 0.03125, 0.02875, 0.03625, 0.0375,
0.03625, 0.03375, 0.03125, 0.03, 0.025, 0.03, 0.02875, 0.03,
0.025, 0.025, 0.0225, 0.02875, 0.03, 0.03, 0.0275, 0.0275, 0.03,
0.03125, 0.03, 0.03375, 0.03, 0.02875, 0.0225, 0.02375, 0.02,
0.0125, 0.01375, 0.01125, 0.01125, 0.01625, 0.015, 0.01375, 0.02125,
0.01875, 0.0225, 0.01625, 0.01875, 0.01875, 0.02125, 0.02, 0.0225,
0.0225, 0.02125, 0.0225, 0.02375, 0.025, 0.0275, 0.0275, 0.02625,
0.025, 0.02625, 0.0275, 0.02875, 0.02875, 0.02875, 0.0275, 0.02625,
0.02875, 0.0275, 0.0275, 0.03, 0.02875, 0.03, 0.02875, 0.03125,
0.02875, 0.02875, 0.02625, 0.02625, 0.02625, 0.025, 0.025, 0.02625,
0.02625, 0.025, 0.025, 0.02375, 0.02375, 0.0225, 0.0225, 0.0225,
0.02375, 0.02375, 0.02125, 0.02125, 0.0175, 0.0175, 0.01875,
0.0175, 0.0275, 0.02375, 0.0225, 0.01875, 0.02125, 0.015, 0.02,
0.0175, 0.0175, 0.02, 0.01875, 0.0175, 0.01875, 0.0225, 0.02,
0.02125, 0.0175, 0.01625, 0.015, 0.015, 0.01625, 0.01625, 0.01625,
0.01375, 0.0125, 0.02, 0.0175, 0.01375, 0.01625, 0.01625, 0.01625,
0.02, 0.02125, 0.0175, 0.02, 0.02, 0.0225, 0.01875, 0.0225, 0.0225,
0.0175, 0.025, 0.02125, 0.01875, 0.02125, 0.01875, 0.0275, 0.025,
0.0175, 0.01875, 0.02, 0.02375, 0.02125, 0.01875, 0.02125, 0.02,
0.0175, 0.02, 0.0175, 0.02, 0.0275, 0.0275, 0.02875, 0.0175,
0.01875, 0.015, 0.01625, 0.01375, 0.0125, 0.015, 0.01625, 0.015,
0.01375, 0.015, 0.01625, 0.0175, 0.015, 0.01625, 0.015, 0.01625,
0.0175, 0.0175, 0.01625, 0.015, 0.01375, 0.01375, 0.015, 0.01375,
0.015, 0.01125, 0.01125, 0.01125, 0.005, 0.00625, 0.005, 0.00375,
0.0025, 0.00375, 0.00125, 0.005, 0.00125, 0.00625, 0.00125, 0.005,
0.0025, 0.0025, 0.005, 0.0025, 0.00125, 0.00125, 0.0025, 0.00125,
0.00375, 0.00625, 0.00125, 0.00125, 0.005, 0.0025, 0.00125, 0.00375,
0.0025, 0.00125, 0.00125, 0.00125, 0.0025, 0.005, 0.00875, 0.0025
), Prices = c(112.171875, 114.67578125, 115.3828125, 116.453125,
128.5234375, 130.66015625, 130.43359375, 128.796875, 135.42578125,
135.29296875, 137.3203125, 138.22265625, 137.73046875, 136.21875,
135.2421875, 136.1328125, 145.53125, 149.71484375, 144.4609375,
147.91796875, 153.69140625, 158.04296875, 149.96875, 152.41796875,
137.05859375, 149.8046875, 154.43359375, 152.6796875, 157.375,
153.328125, 144.58203125, 151.64453125, 161.16796875, 154.66015625,
143.1875, 131.78125, 132.09375, 129.5859375, 124.87109375, 124.765625,
132.125, 127.30078125, 142.25, 144.9296875, 142.59765625, 137.7265625,
132.74609375, 130.265625, 119.9609375, 130.57421875, 128.0078125,
130.91015625, 120.2265625, 120.26953125, 114.88671875, 128.625,
131.625, 131.76953125, 126.2265625, 126.40234375, 132.16796875,
135.171875, 132.46484375, 141.47265625, 132.8125, 129.984375,
115.28125, 118.359375, 109.4609375, 91.390625, 94.30859375, 95.36328125,
95.609375, 100.34375, 105.66796875, 103.2265625, 106.765625,
102.875, 110.8515625, 102.5703125, 105.9453125, 103.14453125,
107.0078125, 103.52734375, 107.6171875, 111.05859375, 107.2421875,
107.890625, 104.77734375, 109.0625, 114.7421875, 110.24609375,
105.50390625, 105.41796875, 109.87109375, 106.19921875, 111.12109375,
115.94140625, 111.29296875, 106.3984375, 106.2890625, 116.26171875,
106.9921875, 111.1953125, 112.546875, 107.55859375, 112.7109375,
107.76171875, 118.51953125, 112.2578125, 107.96484375, 102.6328125,
111.1640625, 107.3984375, 102.69921875, 107.1953125, 111.30078125,
114.90234375, 102.890625, 110.76171875, 106.921875, 102.90625,
109.55078125, 102.916015625, 106.80078125, 110.32421875, 113.126953125,
102.896484375, 109.046875, 102.48046875, 105.3046875, 107.734375,
102.60546875, 108.078125, 107.765625, 107.68359375, 101.783203125,
102.1953125, 101.625, 107.00390625, 102.029296875, 102.169921875,
107.61328125, 103.005859375, 102.919921875, 103.2890625, 109.10546875,
103.67578125, 104.07421875, 103.4296875, 106.1796875, 102.96484375,
103.0859375, 103.48046875, 106.29296875, 103.58984375, 103.05859375,
102.8125, 102.30078125, 102.3515625, 103.31640625, 104.125, 102.52734375,
102.865234375, 108.66796875, 105.73828125, 101.658203125, 102.05078125,
104.02734375, 106.25, 102.0625, 106.3984375, 110.3984375, 103.83984375,
106.25390625, 106.109375, 102.201171875, 106.24609375, 102.328125,
107.5078125, 107.73828125, 102.29296875, 102.46875, 105.95703125,
111.41796875, 107.87109375, 102.60546875, 103.1328125, 103.0859375,
102.421875, 106.0703125, 102.54296875, 106.203125, 110.8828125,
106.8125, 111.625, 105.390625, 107.77734375, 102.3046875, 107.08203125,
104.9765625, 103.6015625, 102.40234375, 106.4296875, 104.61328125,
102.2734375, 104.68359375, 106.453125, 108.2421875, 101.40625,
106.484375, 104.74609375, 102.98046875, 107.28125, 105.83984375,
101.646484375, 102.82421875, 104.35546875, 101.474609375, 105.76953125,
102.64453125, 105.96484375, 101.255859375, 103.4609375, 103.36328125,
100.73046875, 100.3125, 100.69140625, 100.3203125, 100.16015625,
100.12109375, 99.98828125, 99.4453125, 99.84765625, 97.9140625,
99.9765625, 99.3671875, 99.5625, 100.140625, 99.30078125, 99.48828125,
99.9609375, 99.80859375, 99.44921875, 99.947265625, 98.4296875,
97.68359375, 99.7890625, 99.9375, 99.15234375, 99.40234375, 99.76171875,
98.23828125, 99.3515625, 99.931640625, 99.7421875, 99.927734375,
99.30859375, 99.0078125, 99.91796875, 100.09765625)), row.names = c(NA,
261L), class = "data.frame")
df为: ISIN YrsToMat Coupons Prices
1 US912810EM63 1.000000 0.07250 112.17188
2 US912810EN47 1.000000 0.07625 114.67578
3 US912810EP94 1.000000 0.07125 115.38281
4 US912810EQ77 1.083333 0.06250 116.45312
5 US912810ES34 1.083333 0.07500 128.52344
6 US912810ET17 1.083333 0.07625 130.66016
7 US912810EV62 1.083333 0.06875 130.43359
8 US912810EW46 1.166667 0.06000 128.79688
9 US912810EX29 1.166667 0.06750 135.42578
10 US912810EY02 1.166667 0.06500 135.29297
11 US912810EZ76 1.166667 0.06625 137.32031
12 US912810FA17 1.250000 0.06375 138.22266
13 US912810FB99 1.250000 0.06125 137.73047
14 US912810FE39 1.250000 0.05500 136.21875
15 US912810FF04 1.250000 0.05250 135.24219
16 US912810FG86 1.250000 0.05250 136.13281
17 US912810FJ26 1.333333 0.06125 145.53125
18 US912810FM54 1.333333 0.06250 149.71484
19 US912810FP85 1.333333 0.05375 144.46094
20 US912810FT08 1.333333 0.04500 147.91797
21 US912810PT97 1.416667 0.04750 153.69141
22 US912810PU60 1.416667 0.05000 158.04297
23 US912810PW27 1.416667 0.04375 149.96875
24 US912810PX00 1.416667 0.04500 152.41797
25 US912810QA97 1.500000 0.03500 137.05859
26 US912810QB70 1.500000 0.04250 149.80469
27 US912810QC53 1.500000 0.04500 154.43359
28 US912810QD37 1.500000 0.04375 152.67969
29 US912810QE10 1.500000 0.04625 157.37500
30 US912810QH41 1.583333 0.04375 153.32812
31 US912810QK79 1.583333 0.03875 144.58203
32 US912810QL52 1.583333 0.04250 151.64453
33 US912810QN19 1.583333 0.04750 161.16797
34 US912810QQ40 1.666667 0.04375 154.66016
35 US912810QS06 1.666667 0.03750 143.18750
36 US912810QT88 1.666667 0.03125 131.78125
37 US912810QU51 1.666667 0.03125 132.09375
38 US912810QW18 1.750000 0.03000 129.58594
39 US912810QX90 1.750000 0.02750 124.87109
40 US912810QY73 1.750000 0.02750 124.76562
41 US912810QZ49 1.750000 0.03125 132.12500
42 US912810RB61 1.750000 0.02875 127.30078
43 US912810RC45 1.750000 0.03625 142.25000
44 US912810RD28 1.833333 0.03750 144.92969
45 US912810RE01 1.833333 0.03625 142.59766
46 US912810RG58 1.833333 0.03375 137.72656
47 US912810RH32 1.833333 0.03125 132.74609
48 US912810RJ97 1.916667 0.03000 130.26562
49 US912810RK60 1.916667 0.02500 119.96094
50 US912810RM27 1.916667 0.03000 130.57422
51 US912810RN00 1.916667 0.02875 128.00781
52 US912810RP57 2.000000 0.03000 130.91016
53 US912810RQ31 2.000000 0.02500 120.22656
54 US912810RS96 2.000000 0.02500 120.26953
55 US912810RT79 2.083333 0.02250 114.88672
56 US912810RU43 2.083333 0.02875 128.62500
57 US912810RV26 2.166667 0.03000 131.62500
58 US912810RX81 2.166667 0.03000 131.76953
59 US912810RY64 2.166667 0.02750 126.22656
60 US912810RZ30 2.250000 0.02750 126.40234
61 US912810SA79 2.250000 0.03000 132.16797
62 US912810SC36 2.250000 0.03125 135.17188
63 US912810SD19 2.250000 0.03000 132.46484
64 US912810SE91 2.250000 0.03375 141.47266
65 US912810SF66 2.333333 0.03000 132.81250
66 US912810SH23 2.333333 0.02875 129.98438
67 US912810SJ88 2.333333 0.02250 115.28125
68 US912810SK51 2.416667 0.02375 118.35938
69 US912810SL35 2.416667 0.02000 109.46094
70 US912810SN90 2.416667 0.01250 91.39062
71 US912810SP49 2.500000 0.01375 94.30859
72 US912810SQ22 2.500000 0.01125 95.36328
73 US912810SR05 2.500000 0.01125 95.60938
74 US912810SS87 2.500000 0.01625 100.34375
75 US9128282A70 2.583333 0.01500 105.66797
76 US9128282D10 2.583333 0.01375 103.22656
77 US9128282N91 2.583333 0.02125 106.76562
78 US9128282P40 2.666667 0.01875 102.87500
79 US9128282R06 2.666667 0.02250 110.85156
80 US9128282S88 2.666667 0.01625 102.57031
81 US9128282U35 2.750000 0.01875 105.94531
82 US9128282W90 2.750000 0.01875 103.14453
83 US9128282Y56 2.750000 0.02125 107.00781
84 US9128283C28 2.750000 0.02000 103.52734
85 US9128283D01 2.750000 0.02250 107.61719
86 US9128283F58 2.833333 0.02250 111.05859
87 US9128283J70 2.833333 0.02125 107.24219
88 US9128283P31 2.833333 0.02250 107.89062
89 US9128283U26 2.916667 0.02375 104.77734
90 US9128283V09 2.916667 0.02500 109.06250
91 US9128283W81 2.916667 0.02750 114.74219
92 US9128283Z13 3.000000 0.02750 110.24609
93 US9128284A52 3.000000 0.02625 105.50391
94 US9128284D91 3.000000 0.02500 105.41797
95 US9128284F40 3.000000 0.02625 109.87109
96 US9128284L18 3.083333 0.02750 106.19922
97 US9128284M90 3.083333 0.02875 111.12109
98 US9128284N73 3.166667 0.02875 115.94141
99 US9128284R87 3.166667 0.02875 111.29297
100 US9128284S60 3.250000 0.02750 106.39844
101 US9128284U17 3.250000 0.02625 106.28906
102 US9128284V99 3.250000 0.02875 116.26172
103 US9128284X55 3.333333 0.02750 106.99219
104 US9128284Z04 3.416667 0.02750 111.19531
105 US9128285C00 3.416667 0.03000 112.54688
106 US9128285D82 3.500000 0.02875 107.55859
107 US9128285J52 3.500000 0.03000 112.71094
108 US9128285K26 3.583333 0.02875 107.76172
109 US9128285M81 3.583333 0.03125 118.51953
110 US9128285N64 3.666667 0.02875 112.25781
111 US9128285P13 3.666667 0.02875 107.96484
112 US9128285R78 3.750000 0.02625 102.63281
113 US9128285T35 3.750000 0.02625 111.16406
114 US9128285U08 3.750000 0.02625 107.39844
115 US9128285V80 3.833333 0.02500 102.69922
116 US9128285Z94 3.833333 0.02500 107.19531
117 US9128286A35 3.916667 0.02625 111.30078
118 US9128286B18 3.916667 0.02625 114.90234
119 US9128286C90 4.000000 0.02500 102.89062
120 US9128286F22 4.000000 0.02500 110.76172
121 US9128286G05 4.000000 0.02375 106.92188
122 US9128286H87 4.000000 0.02375 102.90625
123 US9128286L99 4.083333 0.02250 109.55078
124 US9128286M72 4.083333 0.02250 102.91602
125 US9128286R69 4.166667 0.02250 106.80078
126 US9128286S43 4.166667 0.02375 110.32422
127 US9128286T26 4.250000 0.02375 113.12695
128 US9128286U98 4.250000 0.02125 102.89648
129 US9128286X38 4.250000 0.02125 109.04688
130 US9128286Y11 4.250000 0.01750 102.48047
131 US9128286Z85 4.333333 0.01750 105.30469
132 US9128287B09 4.333333 0.01875 107.73438
133 US9128287C81 4.416667 0.01750 102.60547
134 US912828B667 4.416667 0.02750 108.07812
135 US912828D564 4.500000 0.02375 107.76562
136 US912828G385 4.500000 0.02250 107.68359
137 US912828G534 4.500000 0.01875 101.78320
138 US912828G872 4.583333 0.02125 102.19531
139 US912828H862 4.583333 0.01500 101.62500
140 US912828J272 4.666667 0.02000 107.00391
141 US912828J439 4.666667 0.01750 102.02930
142 US912828J769 4.750000 0.01750 102.16992
143 US912828K742 4.750000 0.02000 107.61328
144 US912828L245 4.750000 0.01875 103.00586
145 US912828L575 4.750000 0.01750 102.91992
146 US912828M490 4.833333 0.01875 103.28906
147 US912828M565 4.833333 0.02250 109.10547
148 US912828M805 4.916667 0.02000 103.67578
149 US912828N308 4.916667 0.02125 104.07422
150 US912828P386 5.000000 0.01750 103.42969
151 US912828P469 5.000000 0.01625 106.17969
152 US912828P790 5.083333 0.01500 102.96484
153 US912828Q293 5.166667 0.01500 103.08594
154 US912828R283 5.250000 0.01625 103.48047
155 US912828R366 5.250000 0.01625 106.29297
156 US912828R697 5.250000 0.01625 103.58984
157 US912828S356 5.333333 0.01375 103.05859
158 US912828S927 5.416667 0.01250 102.81250
159 US912828SF82 5.500000 0.02000 102.30078
160 US912828SV33 5.500000 0.01750 102.35156
161 US912828T263 5.583333 0.01375 103.31641
162 US912828T917 5.666667 0.01625 104.12500
163 US912828TJ95 5.750000 0.01625 102.52734
164 US912828TY62 5.750000 0.01625 102.86523
165 US912828U246 5.750000 0.02000 108.66797
166 US912828U576 5.833333 0.02125 105.73828
167 US912828U659 5.916667 0.01750 101.65820
168 US912828U816 6.000000 0.02000 102.05078
169 US912828UN88 6.000000 0.02000 104.02734
170 US912828V236 6.000000 0.02250 106.25000
171 US912828V723 6.083333 0.01875 102.06250
172 US912828V806 6.166667 0.02250 106.39844
173 US912828V988 6.250000 0.02250 110.39844
174 US912828VB32 6.250000 0.01750 103.83984
175 US912828VS66 6.250000 0.02500 106.25391
176 US912828W481 6.333333 0.02125 106.10938
177 US912828W556 6.416667 0.01875 102.20117
178 US912828W713 6.500000 0.02125 106.24609
179 US912828W895 6.500000 0.01875 102.32812
180 US912828WE61 6.583333 0.02750 107.50781
181 US912828WJ58 6.666667 0.02500 107.73828
182 US912828WZ90 6.750000 0.01750 102.29297
183 US912828X471 6.750000 0.01875 102.46875
184 US912828X703 6.750000 0.02000 105.95703
185 US912828X885 6.833333 0.02375 111.41797
186 US912828XB14 6.916667 0.02125 107.87109
187 US912828XD79 7.000000 0.01875 102.60547
188 US912828XG01 7.000000 0.02125 103.13281
189 US912828XQ82 7.250000 0.02000 103.08594
190 US912828XR65 7.500000 0.01750 102.42188
191 US912828XT22 7.750000 0.02000 106.07031
192 US912828XW50 7.750000 0.01750 102.54297
193 US912828XX34 8.000000 0.02000 106.20312
194 US912828XZ81 8.000000 0.02750 110.88281
195 US912828Y610 8.250000 0.02750 106.81250
196 US912828Y792 8.250000 0.02875 111.62500
197 US912828Y875 8.500000 0.01750 105.39062
198 US912828Y958 8.750000 0.01875 107.77734
199 US912828YA22 8.750000 0.01500 102.30469
200 US912828YB05 9.000000 0.01625 107.08203
201 US912828YD60 9.250000 0.01375 104.97656
202 US912828YE44 9.500000 0.01250 103.60156
203 US912828YF19 9.500000 0.01500 102.40234
204 US912828YG91 9.750000 0.01625 106.42969
205 US912828YH74 10.000000 0.01500 104.61328
206 US912828YK04 10.250000 0.01375 102.27344
207 US912828YM69 15.250000 0.01500 104.68359
208 US912828YQ73 16.250000 0.01625 106.45312
209 US912828YS30 16.500000 0.01750 108.24219
210 US912828YT13 17.250000 0.01500 101.40625
211 US912828YU85 17.500000 0.01625 106.48438
212 US912828YV68 18.250000 0.01500 104.74609
213 US912828YW42 18.500000 0.01625 102.98047
214 US912828YX25 18.750000 0.01750 107.28125
215 US912828YY08 19.000000 0.01750 105.83984
216 US912828YZ72 19.250000 0.01625 101.64648
217 US912828Z294 19.500000 0.01500 102.82422
218 US912828Z526 19.500000 0.01375 104.35547
219 US912828Z609 19.750000 0.01375 101.47461
220 US912828Z781 19.750000 0.01500 105.76953
221 US912828Z864 20.000000 0.01375 102.64453
222 US912828Z948 20.250000 0.01500 105.96484
223 US912828ZA13 20.500000 0.01125 101.25586
224 US912828ZB95 20.750000 0.01125 103.46094
225 US912828ZC78 21.000000 0.01125 103.36328
226 US912828ZD51 21.250000 0.00500 100.73047
227 US912828ZE35 21.500000 0.00625 100.31250
228 US912828ZF00 21.750000 0.00500 100.69141
229 US912828ZG82 22.000000 0.00375 100.32031
230 US912828ZH65 22.250000 0.00250 100.16016
231 US912828ZL77 22.500000 0.00375 100.12109
232 US912828ZM50 22.750000 0.00125 99.98828
233 US912828ZN34 23.000000 0.00500 99.44531
234 US912828ZP81 23.250000 0.00125 99.84766
235 US912828ZQ64 23.500000 0.00625 97.91406
236 US912828ZR48 23.750000 0.00125 99.97656
237 US912828ZS21 24.000000 0.00500 99.36719
238 US912828ZT04 24.250000 0.00250 99.56250
239 US912828ZU76 24.500000 0.00250 100.14062
240 US912828ZV59 24.750000 0.00500 99.30078
241 US912828ZW33 25.000000 0.00250 99.48828
242 US912828ZX16 25.250000 0.00125 99.96094
243 US912828ZY98 25.500000 0.00125 99.80859
244 US91282CAB72 25.750000 0.00250 99.44922
245 US91282CAC55 26.000000 0.00125 99.94727
246 US91282CAD39 26.250000 0.00375 98.42969
247 US91282CAE12 26.500000 0.00625 97.68359
248 US91282CAF86 26.750000 0.00125 99.78906
249 US91282CAG69 27.000000 0.00125 99.93750
250 US91282CAH43 27.250000 0.00500 99.15234
251 US91282CAJ09 27.50000 0.00250 99.40234
252 US91282CAK71 27.75000 0.00125 99.76172
253 US91282CAL54 28.00000 0.00375 98.23828
254 US91282CAM38 28.25000 0.00250 99.35156
255 US91282CAN11 28.50000 0.00125 99.93164
256 US91282CAP68 28.75000 0.00125 99.74219
最佳答案
它与您的dateparams有关。如果使用此设置运行您的示例,则会得到一条流畅的线条:
curveparams <- list(method="ExponentialSplinesFitting",
origDate = Sys.Date())
dateparams <- list(settlementDays=0, period="Semiannual",
dayCounter="ActualActual",
businessDayConvention ="Unadjusted")
curve <- FittedBondCurve(curveparams = curveparams,
lengths = df$YrsToMat,
coupons = df$Coupons,
marketQuotes = df$Prices,
dateparams = dateparams)
z <- zoo::zoo(curve$table$zeroRates, order.by=curve$table$date)
plot(z)