&引用;指定的时间序列参数无效";R中的错误

&引用;指定的时间序列参数无效";R中的错误,r,R,我试图使用USTYC软件包()中的数据修改YieldCurve文档中的Nelson/Siegel示例 原代码为: library(YieldCurve) ### Nelson.Siegel function and Fed data-set ### data(FedYieldCurve) rate.Fed = first(FedYieldCurve,'5 month') maturity.Fed <- c(3/12, 0.5, 1,2,3,5,7,10) NSParameters <

我试图使用USTYC软件包()中的数据修改YieldCurve文档中的Nelson/Siegel示例

原代码为:

library(YieldCurve)

### Nelson.Siegel function and Fed data-set ###
data(FedYieldCurve)
rate.Fed = first(FedYieldCurve,'5 month')
maturity.Fed <- c(3/12, 0.5, 1,2,3,5,7,10)
NSParameters <- Nelson.Siegel( rate= rate.Fed, maturity=maturity.Fed )
y <- NSrates(NSParameters[5,], maturity.Fed)
库(屈服曲线)
###Nelson.Siegel函数和Fed数据集###
数据(FedYieldCurve)
利率.联邦储备=第一(FedYieldCurve,“5个月”)

美联储解决了这个问题:“收益率”的格式是错误的。第四行需要是:

yields <- as.xts(xlist$df)
产量
yields <- as.xts(xlist$df)