curvePredict
语法
curvePredict(curve, dt)
详情
在给定的曲线上,预测指定点位(由 dt 确定)的曲线值。目前仅支持零息利率曲线。
返回值:DOUBLE 类型标量或向量。
参数
curve MKTDATA 类型对象(IrYieldCurve)。
dt DOUBLE 类型标量/向量,或 DATE 类型标量/向量。
-
当类型为 DOUBLE 时,表示以“年”为单位的时间。
-
当类型为 DATE 时,表示具体的日期。
例子
curveDict = {
"mktDataType": "Curve",
"curveType": "IrYieldCurve",
"referenceDate": 2025.08.18,
"currency": "CNY",
"dayCountConvention": "ActualActualISDA",
"compounding": "Continuous",
"interpMethod": "Linear",
"extrapMethod": "Flat",
"frequency": "Annual",
"dates": [2025.08.21,
2025.08.27,
2025.09.03,
2025.09.10,
2025.09.22,
2025.10.20,
2025.11.20,
2026.02.24,
2026.05.20,
2026.08.20,
2027.02.22,
2027.08.20,
2028.08.21],
"values":[1.5113,
1.5402,
1.5660,
1.5574,
1.5556,
1.5655,
1.5703,
1.5934,
1.6040,
1.6020,
1.5928,
1.5842,
1.6068]/100
}
curve = parseMktData(curveDict)
curvePredict(curve, 2025.10.18)
// output: 0.0156
curvePredict(curve, 1.0)
// output: 0.0160
print curvePredict(curve, [2025.10.18, 2026.10.18])
// output: [0.0156,0.0159]
print curvePredict(curve, [1.0, 2.0])
// output: [0.0160,0.0158]
相关函数:parseMktData