我有两个带有返回值和相同索引的单列xts对象,但是Return.excess
给我一个xts输出,具有相同的索引,但只有0作为值。这是为什么?以前在我的代码中,我对Return.excess
没问题。而且,如果我自己减去这些值,我肯定不会只得到0,即两个xts-objetcs不相同。
我的代码并输出为dput
:
dput(test2 <- Return.excess(BAB_PF_excess_returns_adj_positive,BAB_PF_excess_returns_adj_negative))
structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0), index = structure(c(1012435200, 1014854400,
1017273600, 1020124800, 1022803200, 1025222400, 1028073600, 1030665600,
1033344000, 1036022400, 1038528000, 1041206400, 1043971200, 1046390400,
1049068800, 1051660800, 1054252800, 1056931200, 1059609600, 1062115200,
1064880000, 1067558400, 1069977600, 1072742400, 1075420800, 1077840000,
1080691200, 1083283200, 1085702400, 1088553600, 1091145600, 1093910400,
1096502400, 1099008000, 1101772800, 1104364800, 1107129600, 1109548800,
1112227200, 1114732800, 1117497600, 1120089600, 1122595200, 1125446400,
1128038400, 1130716800, 1133308800, 1135900800, 1138665600, 1141084800,
1143763200, 1146182400, 1149033600, 1151625600, 1154304000, 1156982400,
1159488000, 1162252800, 1164844800, 1167350400, 1170201600, 1172620800,
1175212800, 1177891200, 1180569600, 1183075200, 1185840000, 1188518400,
1190937600, 1193788800, 1196380800, 1198800000, 1201737600, 1204243200,
1206921600, 1209513600, 1212105600, 1214784000, 1217462400, 1219968000,
1222732800, 1225411200, 1227830400, 1230595200, 1233273600, 1235692800,
1238457600, 1241049600, 1243555200, 1246320000, 1248998400, 1251676800,
1254268800, 1256860800, 1259539200, 1262131200, 1264723200, 1267142400,
1269993600, 1272585600, 1275264000, 1277856000, 1280448000, 1283212800,
1285804800, 1288310400, 1291075200, 1293667200, 1296432000, 1298851200,
1301529600, 1304035200, 1306800000, 1309392000, 1311897600, 1314748800,
1317340800, 1320019200, 1322611200, 1325203200, 1327968000, 1330473600,
1333065600, 1335744000, 1338422400, 1340928000, 1343692800, 1346371200,
1348790400, 1351641600, 1354233600, 1356652800, 1359590400, 1362009600,
1364428800, 1367280000, 1369958400, 1372377600, 1375228800, 1377820800,
1380499200, 1383177600, 1385683200, 1388361600, 1391126400, 1393545600,
1396224000, 1398816000, 1401408000, 1404086400, 1406764800, 1409270400,
1412035200, 1414713600, 1417132800, 1419897600, 1422576000, 1424995200,
1427760000, 1430352000, 1432857600, 1435622400, 1438300800, 1440979200,
1443571200, 1446163200, 1448841600, 1451433600, 1454025600, 1456704000,
1459382400, 1461888000, 1464652800, 1467244800, 1469750400, 1472601600,
1475193600, 1477872000, 1480464000, 1483056000, 1485820800, 1488240000,
1490918400, 1493337600, 1496188800, 1498780800, 1501459200, 1504137600,
1506643200, 1509408000, 1.512e+09, 1514505600), tzone = "UTC", tclass = "Date"), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", .Dim = c(192L,
1L), .Dimnames = list(NULL, "portfolio.returns > portfolio.returns"), class = c("xts",
"zoo"))