last(tmp.predict,3)
SP5.Open SP5.High SP5.Low SP5.Close SP5.Volume spline eps
10 2020 3385.870 3549.850 3233.940 3269.960 89737600000 3475.842 3450.187
11 2020 3296.200 3645.990 3279.740 3621.630 100977880000 3465.431 3396.378
12 2020 3645.870 3760.200 3633.400 3756.070 96056410000 3420.055 3238.727
10 2020 3385.870 3549.850 3233.940 3269.960 89737600000 3475.842 3450.187
11 2020 3296.200 3645.990 3279.740 3621.630 100977880000 3465.431 3396.378
12 2020 3645.870 3760.200 3633.400 3756.070 96056410000 3420.055 3238.727
create the entry for "2021-01-01". first to create single row matrix and convert to the xts.
as.xts(matrix(c(as.vector(apply.monthly(SP5["2021-01"],mean)),3395,3180),nrow=1),as.Date("2021-01-01"))[,-5]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
2021-01-01 3797.387 3818.136 3768.962 3793.748 5555199474 3395 3180
2021-01-01 3797.387 3818.136 3768.962 3793.748 5555199474 3395 3180
run append.
append(tmp.predict,as.xts(matrix(c(as.vector(apply.monthly(SP5["2021-01"],mean)),3395,3180),nrow=1),as.Date("2021-01-01"))[,-5]) %>% last(.,6)
SP5.Open SP5.High SP5.Low SP5.Close SP5.Volume spline eps
8 2020 3288.260 3514.770 3284.530 3500.310 84402300000 3270.029 3340.749
9 2020 3507.440 3588.110 3209.450 3363.000 92084120000 3416.319 3423.604
10 2020 3385.870 3549.850 3233.940 3269.960 89737600000 3475.842 3450.187
11 2020 3296.200 3645.990 3279.740 3621.630 100977880000 3465.431 3396.378
12 2020 3645.870 3760.200 3633.400 3756.070 96056410000 3420.055 3238.727
1 2021 3797.387 3818.136 3768.962 3793.748 5555199474 3395.000 3180.000
8 2020 3288.260 3514.770 3284.530 3500.310 84402300000 3270.029 3340.749
9 2020 3507.440 3588.110 3209.450 3363.000 92084120000 3416.319 3423.604
10 2020 3385.870 3549.850 3233.940 3269.960 89737600000 3475.842 3450.187
11 2020 3296.200 3645.990 3279.740 3621.630 100977880000 3465.431 3396.378
12 2020 3645.870 3760.200 3633.400 3756.070 96056410000 3420.055 3238.727
1 2021 3797.387 3818.136 3768.962 3793.748 5555199474 3395.000 3180.000
0 件のコメント:
コメントを投稿