Computes a ‘combined forecast’ from a pool of individual model forecasts using trimmed mean at each point in time.
comb_TA(x, trim_factor = NULL, criterion = "RMSE")
An object of class foreccomb
. Contains training set (actual values + matrix of model forecasts) and optionally a test set.
numeric. Must be between 0 (simple average) and 0.5 (median).
If trim_factor
is not specified, an optimization criterion for automated trimming needs to be defined. One of
"MAE", "MAPE", or "RMSE" (default).
Returns an object of class foreccomb_res
with the following components:
Returns the used forecast combination method.
Returns the individual input models that were used for the forecast combinations.
Returns the combination weights obtained by applying the combination method to the training set.
Returns the trim factor, \(\lambda\).
Returns the fitted values of the combination method for the training set.
Returns range of summary measures of the forecast accuracy for the training set.
Returns forecasts produced by the combination method for the test set. Only returned if input included a forecast matrix for the test set.
Returns range of summary measures of the forecast accuracy for the test set. Only returned if input included a forecast matrix and a vector of actual values for the test set.
Returns the data forwarded to the method.
Suppose \(y_t\) is the variable of interest, there are \(N\) not perfectly collinear predictors, \(\mathbf{f}_t = (f_{1t}, \ldots, f_{Nt})'\). For each point in time, the order forecasts are computed:
$$\mathbf{f}_t^{ord} = (f_{(1)t}, \ldots, f_{(N)t})'$$
Using a trim factor \(\lambda\) (i.e., the top/bottom \(\lambda \%\) are trimmed) the combined forecast is calculated as:
$$\hat{y}_t = \frac{1}{N(1-2\lambda)} \sum_{i = \lambda N +1}^{(1-\lambda)N} f_{(i)t}$$
The trimmed mean is an interpolation between the simple average and the median. It is an appealing simple, rank-based combination method that is less sensitive to outliers than the simple average approach, and has been proposed by authors such as Armstrong (2001), Stock and Watson (2004), and Jose and Winkler (2008).
This method allows the user to select \(\lambda\) (by specifying trim_factor
), or to leave the selection to
an optimization algorithm -- in which case the optimization criterion has to be selected (one of "MAE", "MAPE", or "RMSE").
Armstrong, J. S. (2001). Combining Forecasts. In: Armstrong, J. S. (Ed.), Principles of Forecasting. Springer, Boston, MA, 417--439.
Jose, V. R. R., and Winkler, R. L. (2008). Simple Robust Averages of Forecasts: Some Empirical Results. International Journal of Forecasting, 24(1), 163--169.
Stock, J. H., and Watson, M. W. (2004). Combination Forecasts of Output Growth in a Seven-Country Data Set. Journal of Forecasting, 23(6), 405--430.
obs <- rnorm(100)
preds <- matrix(rnorm(1000, 1), 100, 10)
train_o<-obs[1:80]
train_p<-preds[1:80,]
test_o<-obs[81:100]
test_p<-preds[81:100,]
## User-selected trim factor:
data<-foreccomb(train_o, train_p, test_o, test_p)
comb_TA(data, trim_factor=0.1)
#> $Method
#> [1] "Trimmed Mean"
#>
#> $Models
#> [1] "Series 1" "Series 2" "Series 3" "Series 4" "Series 5" "Series 6"
#> [7] "Series 7" "Series 8" "Series 9" "Series 10"
#>
#> $Fitted
#> Time Series:
#> Start = 1
#> End = 80
#> Frequency = 1
#> [1] 0.7863893 0.8585404 1.3960043 1.3771952 0.6831947 1.6795665 0.4239114
#> [8] 0.9787793 1.2181581 0.5742269 0.9609709 1.1702420 0.8872245 0.8189316
#> [15] 1.0322312 1.0766203 1.3357293 1.4699081 0.9488401 0.6332017 0.8167393
#> [22] 0.8075260 0.5934076 0.9694834 1.1770592 1.3832520 1.2140475 0.7646082
#> [29] 0.7026527 0.7649137 1.6911155 0.9950730 0.2576139 1.3492794 1.0435063
#> [36] 0.5719704 1.0444462 1.1249526 1.2013032 1.1462020 1.0718216 1.0221110
#> [43] 0.8293090 1.0349669 1.0466667 0.9009279 1.4202057 0.3935386 1.1622479
#> [50] 1.3366454 0.6557590 1.4577674 1.7520839 1.2507431 1.2156300 1.5954632
#> [57] 1.0429295 1.0825666 0.7452150 1.2418222 0.7020988 0.4429308 1.0123801
#> [64] 0.8336380 0.8839146 0.5747614 0.6265187 1.1114676 0.8397330 0.4537635
#> [71] 1.0258513 0.8785424 1.1667536 0.9055352 0.8595829 1.0343174 1.5303992
#> [78] 0.7558269 0.6254657 1.2505830
#>
#> $Accuracy_Train
#> ME RMSE MAE MPE MAPE ACF1 Theil's U
#> Test set -1.029504 1.329265 1.129074 163.2342 329.7964 -0.1182428 1.966694
#>
#> $Input_Data
#> $Input_Data$Actual_Train
#> Time Series:
#> Start = 1
#> End = 80
#> Frequency = 1
#> [1] -1.12023850 0.72812842 -1.22469330 0.80575706 -0.55979953 -0.35669315
#> [7] -1.49320292 -0.53923261 0.85872649 -1.00745112 -0.92233675 0.30379526
#> [13] 0.33000396 -0.80832967 -0.91868667 -0.26527531 1.03099672 -0.68352448
#> [19] -0.22649681 0.16996093 -0.72686555 0.78154113 -0.25901027 -0.51562993
#> [25] 0.35920891 -0.65506209 0.82451908 -2.24258789 0.92700850 -0.32961858
#> [31] 1.07310626 2.09001176 -0.78025595 0.95939569 0.76098539 0.37805308
#> [37] 0.49713458 -0.71677396 0.29118541 -1.31751275 0.98550032 0.82547334
#> [43] -0.90122912 -0.78791398 1.88151833 0.61894917 -0.76548873 -0.77354096
#> [49] -0.06727977 0.22156782 0.68812811 0.18016857 1.31596181 0.21298099
#> [55] 0.69276192 -0.02661631 0.20092330 -0.25920385 -1.18162464 -0.25328611
#> [61] -1.27922444 0.53499682 0.46395551 -0.83119159 0.39662959 1.27430483
#> [67] -0.56857131 -0.52702374 -0.64121262 -0.91254018 -0.07632995 0.06933154
#> [73] 0.24768030 0.14998107 1.86426491 0.92171508 -1.02865530 -0.31774937
#> [79] 0.16147636 -0.86861669
#>
#> $Input_Data$Forecasts_Train
#> Time Series:
#> Start = 1
#> End = 80
#> Frequency = 1
#> Series 1 Series 2 Series 3 Series 4 Series 5 Series 6
#> 1 1.67366932 0.03234905 1.102684857 2.5151592147 0.17008888 -0.40089345
#> 2 0.67997396 0.81701758 0.721478669 0.4618385970 0.70297031 0.43483948
#> 3 0.61337785 2.42278558 2.281219274 2.4685726548 0.79145165 0.61657268
#> 4 2.92423726 0.56668637 -0.785104024 2.8435568233 2.01475814 1.13178825
#> 5 1.59018091 2.27592162 -1.056482607 0.8681924321 0.21043983 0.03313741
#> 6 2.25251154 2.68066796 0.352650355 1.9579250613 1.09485218 1.03387859
#> 7 0.62446091 0.08436869 1.024385493 0.3833482992 -1.90610738 0.28176486
#> 8 0.46801665 1.69599387 0.452534954 2.2938156748 1.23672743 -1.32292469
#> 9 1.93755565 -1.12552096 -0.066994783 2.3045306766 3.09818648 0.97566103
#> 10 0.24862630 -0.40630228 0.532573537 1.7639029999 2.59406122 0.74834723
#> 11 -0.13453965 -0.63299655 1.387970369 0.8748380187 1.96860617 -0.37242917
#> 12 1.97224430 -0.49837354 0.879561850 1.7258584986 -0.06693445 1.71688767
#> 13 1.38299761 0.08617128 1.184151330 -0.2546572631 1.01686285 0.70988191
#> 14 0.78296746 -0.45539420 1.800746192 2.6168234105 0.63798745 0.67517631
#> 15 0.17597094 1.66844942 1.696938871 -0.1140685981 0.25387432 -1.43520246
#> 16 1.98517980 1.13480347 1.896975699 1.5071647308 -0.22963857 0.65760577
#> 17 0.99758654 2.48110602 3.313796972 0.0142234260 0.61736808 2.10227863
#> 18 0.87433193 2.19418763 1.700283976 2.1215480977 1.40557149 -0.05062992
#> 19 0.38505774 0.73978795 1.361441744 2.1507580810 0.12765418 1.05855288
#> 20 0.97483258 -0.15859133 -0.774914712 0.9346792361 1.09731305 0.22534059
#> 21 1.05214845 1.68226533 0.842714576 1.0823548325 1.56730658 0.95482448
#> 22 -0.06648854 0.52508544 -0.075750449 1.9902233761 1.12132279 1.51240807
#> 23 1.65829632 0.02005035 -0.302100942 1.6980403922 0.74772671 -0.44276646
#> 24 -0.13099495 1.60218975 0.166360774 2.1457288410 -0.52106847 2.18246138
#> 25 0.47163128 2.29858293 -0.298526483 0.5866604446 0.81769405 1.86189457
#> 26 1.78429447 0.98517710 2.854852533 1.2709174661 -0.32584228 0.47187518
#> 27 0.39481217 2.00487649 0.546468353 0.9952090628 -1.47207258 1.66308098
#> 28 -0.59921201 1.70129722 1.249990240 1.2037998077 -0.10250556 1.14991191
#> 29 0.85188814 2.42415145 2.366528446 1.2336084982 -0.20598172 0.69574184
#> 30 1.67493620 2.21215307 0.049483919 0.4822264290 0.84830192 -0.26277279
#> 31 0.93990608 1.33605518 0.138540049 1.0756345920 1.82029290 2.83592479
#> 32 2.37813880 1.73391059 -0.099409798 0.7804419606 -0.47370896 0.24012272
#> 33 0.02160552 0.32725434 0.799484413 0.3469453258 -0.41978943 1.44744894
#> 34 1.17534733 1.54575066 1.175986731 1.6211466000 1.47690540 0.47522554
#> 35 0.86541870 1.32876630 1.442959352 0.7458088494 0.65135642 1.82257751
#> 36 0.62657059 0.62827487 0.823734417 0.3285104828 0.22768478 0.80822550
#> 37 0.32509329 1.54194372 -0.290711683 1.4988684434 0.68207974 1.21177882
#> 38 1.78274447 1.60304233 1.295246916 0.0792628726 0.80860760 1.98117669
#> 39 1.61494497 1.20437204 1.676364715 0.6490247992 -0.15718040 1.49856900
#> 40 1.06287945 1.64309393 1.515547172 -0.7583774906 1.86130770 1.09385489
#> 41 0.41703833 -0.03414989 0.049508475 2.4385709498 3.12473426 0.96434352
#> 42 1.33556044 0.91561583 1.911637179 1.5186354681 -0.07777555 0.98893394
#> 43 -2.37646562 3.01172735 0.330554980 1.0505735665 0.38725857 -0.46200888
#> 44 1.14101201 0.11712143 0.836109393 2.4358637735 0.82087078 -0.04694651
#> 45 1.15701789 0.46698143 0.467913548 2.0566592454 1.70188751 1.83137561
#> 46 0.76208415 2.58505391 1.814709975 1.5914550443 0.19140828 1.54980184
#> 47 1.98379728 0.88502854 2.283488446 1.0081638912 2.43310911 2.72968791
#> 48 0.40599280 -0.58797717 -0.697303929 0.4837331523 1.88319566 2.00455677
#> 49 0.84045810 2.05672207 1.402257510 -0.5960420009 1.32177428 -0.34158575
#> 50 1.41396422 2.80234550 2.117110603 0.7227669538 2.38376397 1.46096556
#> 51 0.07104548 2.33565298 -0.779811958 0.6089289223 0.15849831 1.08255150
#> 52 0.90706273 1.93585060 0.587934960 1.5096274837 1.52348959 0.80293423
#> 53 3.27507175 1.66695230 0.533642112 1.8535018418 2.91706620 -0.46539695
#> 54 2.30770959 2.05527975 2.614276899 1.8668891006 -0.42578832 -0.54837246
#> 55 1.93205891 1.69310459 0.594401032 2.9257926775 1.58705697 1.45612091
#> 56 1.96244409 1.76406793 2.523654745 0.8175925352 1.10436711 1.59682732
#> 57 1.33693888 1.56460533 1.075137103 -0.8509415011 2.33975861 1.47008601
#> 58 -0.18177473 0.45288698 2.307065171 1.3980063472 0.21060218 2.09989528
#> 59 0.26618109 -0.42816114 2.422462716 1.5578083664 -0.19733639 0.59669296
#> 60 0.63665050 0.68637264 -0.034247027 2.6973440728 0.70778524 1.06699509
#> 61 0.53838099 1.16831184 0.357739312 0.4484154147 -0.31992478 0.56405267
#> 62 -0.39659895 -0.23171518 0.084855495 -0.6075298297 0.76969478 -0.40833533
#> 63 2.17893789 1.10841232 0.557768774 2.9958100538 -0.31881699 0.87357931
#> 64 1.69852004 1.07098358 -0.156778015 0.7217591349 2.31806573 0.51856383
#> 65 1.10438536 0.46358294 -0.177649425 -0.5627568123 1.19518256 1.19465503
#> 66 -0.60823744 0.63678182 -0.129922881 3.5009086798 0.63971230 0.70213496
#> 67 1.28981184 0.28621699 0.364951490 1.7562429765 -0.01850383 1.94078573
#> 68 2.23888918 -1.72828459 1.174857311 1.1934600449 0.70328697 2.91788128
#> 69 1.51788449 2.90894106 -1.670292627 0.9380951848 1.69673739 0.73973780
#> 70 0.43826679 -1.00823425 -0.008239596 0.5890198516 1.93211169 -0.86320058
#> 71 1.36541709 0.87323776 1.731359746 0.5532699100 0.20299516 1.09754468
#> 72 0.58345485 2.06607752 1.843862441 1.8551239654 -0.14973981 1.33449978
#> 73 0.48206198 0.34393063 0.337299144 2.6209202685 1.84446150 2.20804033
#> 74 2.25170368 0.78906592 -0.622445587 0.8343509025 -0.41873899 2.12299316
#> 75 0.10437819 -0.27149248 0.338439915 0.0007931688 0.69804243 3.24252223
#> 76 1.73204920 1.13214515 1.352115296 0.8989827413 -0.16141940 1.17863136
#> 77 0.85551649 3.19911368 0.490812634 0.0746984075 2.27893292 1.88764621
#> 78 2.01379797 1.99638094 1.064849838 -1.4788065366 0.35503075 0.59479018
#> 79 -0.39651750 1.60969853 0.178052596 -0.7202249717 -0.53999488 2.36407531
#> 80 0.25095943 1.87283676 2.345682116 1.4232762378 2.91147039 1.86588489
#> Series 7 Series 8 Series 9 Series 10
#> 1 1.580025619 0.43147613 0.400291145 0.900529275
#> 2 1.409112352 0.77453610 2.078919611 1.301395512
#> 3 1.413669217 1.16780351 0.256209227 1.861154931
#> 4 1.729224076 0.65010661 0.448784124 1.632657373
#> 5 -1.559899657 0.51583125 2.565669625 1.028337053
#> 6 2.047715195 -0.17614705 2.643443601 2.053555618
#> 7 0.981880079 2.33526740 -0.347042396 0.358125265
#> 8 1.972782664 1.98865980 0.093099169 -0.077580437
#> 9 1.788546374 1.29524300 0.221587172 1.289136060
#> 10 0.595692220 0.56609373 -0.763579234 0.544881243
#> 11 1.188928759 1.69466644 1.530295023 1.518037139
#> 12 1.436695488 3.45739094 -0.317737582 2.015360538
#> 13 1.336395058 2.76900840 -0.479934985 1.635992918
#> 14 0.839626301 0.79698521 -0.603932882 1.473358074
#> 15 1.777769459 2.06286151 0.736053322 2.475937145
#> 16 2.621728690 -1.06391789 0.570484010 1.090387503
#> 17 0.842820981 0.29549223 3.185793373 0.163388524
#> 18 2.162226515 1.27688544 1.577408836 0.641008226
#> 19 0.927655603 -0.09307450 1.217047141 1.773523185
#> 20 0.732517689 2.03443624 -1.157282962 3.504371137
#> 21 0.211162980 0.09143913 0.731963476 0.061050497
#> 22 0.635672889 0.58318832 2.796722157 0.158795461
#> 23 0.115941817 1.00363531 1.983184225 -0.194329173
#> 24 0.582162516 3.50001038 1.579957792 -0.371998941
#> 25 0.667525027 4.24666055 2.148086731 0.564398702
#> 26 3.677226489 1.24648278 1.574006587 0.878409764
#> 27 1.542975629 1.64824176 0.973216990 1.948374990
#> 28 -0.001598207 -0.61693138 1.515181806 1.909781882
#> 29 0.366781761 0.08228873 0.230365499 -0.680300780
#> 30 0.855630793 0.79010832 0.960596095 0.458025776
#> 31 2.939940482 1.54419386 2.032754135 1.944162377
#> 32 0.979179952 1.85815074 1.176415392 1.291772831
#> 33 0.133463005 2.53040119 -0.595500576 -1.240611942
#> 34 1.236081213 2.08779151 -0.268293537 2.266188007
#> 35 1.776289686 0.43001516 0.218055650 1.107436233
#> 36 0.466369297 0.19052971 0.666392882 2.026349990
#> 37 2.322045378 0.95977717 0.751491546 1.384536572
#> 38 -1.037137669 0.91768081 1.118750357 1.394285716
#> 39 0.998788857 0.65764817 1.612676177 1.374401922
#> 40 0.901237242 1.33261658 0.174757900 1.445629202
#> 41 2.113623613 0.28755604 0.678753029 1.625178927
#> 42 1.107543639 1.06490998 1.323464024 -0.109933771
#> 43 0.864046824 1.54800052 2.152478487 0.763568101
#> 44 1.334592870 0.53147706 1.484801782 2.013750019
#> 45 1.714411420 0.11324482 0.920501649 -0.578387726
#> 46 -0.473921651 0.65413353 -0.444562780 1.088393130
#> 47 0.474381650 0.58084743 1.712829515 0.009794148
#> 48 0.049667741 0.85771683 0.620799925 -0.564820182
#> 49 3.619953052 1.64294349 1.399063576 0.976349977
#> 50 -1.545738756 1.13419817 0.783410558 0.676983555
#> 51 -0.015943861 0.22799304 1.081762635 2.031236011
#> 52 1.919797712 1.65080793 1.412569247 1.947698094
#> 53 1.001315725 0.88567783 1.883443662 4.010910337
#> 54 1.076099838 -0.33967694 0.871172663 2.594259096
#> 55 1.085379708 1.57478639 -0.197868187 -0.986262262
#> 56 1.818427695 1.45534150 2.166501380 0.895728792
#> 57 1.561691934 0.30907371 0.338131915 0.687771240
#> 58 1.287403159 0.58569876 1.630162743 0.995877122
#> 59 2.392526865 0.27624513 1.074367279 -0.004765324
#> 60 2.585910447 2.36661583 1.918495053 -1.061062908
#> 61 1.179548509 0.18877460 1.171567445 1.260440708
#> 62 1.230342073 2.38615495 0.852305913 1.642897226
#> 63 1.298122729 -0.52609651 0.615097954 1.785938873
#> 64 1.737037882 -0.12174656 0.327720123 0.716266155
#> 65 2.742294250 1.30433099 -0.033270727 2.020100154
#> 66 1.527161445 0.29652585 1.179614237 -0.253916257
#> 67 0.414198838 -0.68940352 0.968354959 -0.049123710
#> 68 0.668013999 2.92834184 0.587837292 -0.592485298
#> 69 0.480027222 -0.02516995 1.503299565 -0.132747980
#> 70 0.782270570 2.17166762 0.807172366 -0.047293137
#> 71 0.439848056 1.14119727 1.298831647 1.437463684
#> 72 0.616085350 0.05878432 0.886268452 -1.350467860
#> 73 2.282069858 1.00293735 0.833228409 0.284141507
#> 74 1.480804365 0.56132180 0.169735324 1.704749463
#> 75 0.790705351 1.91299154 3.374420511 -0.211209759
#> 76 0.478100463 1.81028184 -0.251761619 1.663934106
#> 77 0.262973836 1.89102529 1.985352120 2.590934293
#> 78 1.269134458 0.96725294 -0.506543666 0.305719591
#> 79 2.104360676 1.38746904 0.008006697 0.652650233
#> 80 0.938653232 -1.11939189 -0.279286707 1.586657959
#>
#> $Input_Data$Actual_Test
#> [1] -0.64932563 0.50611644 0.81203774 -0.85999712 0.25865787 -1.09537361
#> [7] 0.68220772 -0.92065633 -0.17355934 -0.45686399 0.84063980 0.38759957
#> [13] -0.06889376 0.05666342 0.83263032 -1.67775354 -0.91896494 -0.42644707
#> [19] 0.70829920 0.78979415
#>
#> $Input_Data$Forecasts_Test
#> Series 1 Series 2 Series 3 Series 4 Series 5 Series 6
#> [1,] -0.2385209 2.6851917 1.7453790 0.22843982 2.534299727 1.915705701
#> [2,] 0.5249309 1.1520799 1.5808736 1.58425017 0.947530229 -0.581166208
#> [3,] 0.7686324 1.3622033 1.3660068 0.14195706 1.347658488 -0.007512494
#> [4,] 2.0152906 0.2916185 0.5349929 0.66084303 1.097984918 0.274999176
#> [5,] -1.4427914 1.8101231 1.2809614 3.59729840 2.058542056 0.888673119
#> [6,] 1.4794580 2.9930085 0.3875704 2.33299054 0.425449686 0.299506326
#> [7,] 0.6237780 2.2194276 0.6386271 3.79171066 1.177899539 2.466300479
#> [8,] 2.0853976 0.7093061 2.2906456 2.48485684 1.127404318 0.149359423
#> [9,] 0.7346899 1.5795645 2.0465569 0.98497985 -0.003166999 1.274398998
#> [10,] 2.3000687 2.7071646 0.7048814 0.40502586 3.282979314 0.825260671
#> [11,] -0.7514555 0.6526641 2.1661511 0.53391396 -0.653539999 1.636779368
#> [12,] 0.9180536 3.4607535 -0.4557291 1.10403282 2.658309217 1.077199750
#> [13,] 1.2570717 1.9030495 0.7592220 -0.07150113 0.811430378 1.872044020
#> [14,] 0.2734447 2.4997518 2.7541334 0.23862967 1.022196404 0.015218367
#> [15,] 2.6338353 -0.1551206 0.5031059 1.49612998 0.062723655 1.792404662
#> [16,] 1.3281506 1.4497524 0.9466572 1.18441011 0.682133411 1.944448452
#> [17,] -0.2263399 2.3619188 3.6662935 2.05653554 0.552730525 1.235011458
#> [18,] 2.7762135 -0.1120779 1.3369908 1.66543869 1.834644170 0.835215136
#> [19,] 1.0880103 1.3959128 3.5727052 -0.38351722 1.330353395 0.201638755
#> [20,] 0.4920097 1.1378751 1.7912296 1.32907362 0.648367791 0.600733522
#> Series 7 Series 8 Series 9 Series 10
#> [1,] -0.3956995 1.37407379 -0.30568465 1.96672309
#> [2,] 2.0047311 -0.03300400 1.99378023 2.06586426
#> [3,] 2.2589977 1.09796108 1.99324807 1.86953724
#> [4,] 0.2374274 -0.02496359 -0.51917187 1.33380886
#> [5,] 1.7908030 0.56117729 -0.32158455 -0.07322391
#> [6,] 1.1807577 1.57675960 -0.41818523 1.36940910
#> [7,] 0.4383561 0.92449115 1.45608026 2.03840159
#> [8,] -0.2025868 -0.18094510 1.35737236 1.73934300
#> [9,] 0.6620187 -1.18033207 0.82107955 -0.13806651
#> [10,] 1.1629113 -0.22510716 0.01300418 1.57352639
#> [11,] 1.2605888 0.96931935 0.62941535 1.35520261
#> [12,] 2.0587246 2.84175950 -0.16385219 2.80738308
#> [13,] 1.7541318 0.31309164 0.80732829 2.60961469
#> [14,] -0.5883313 1.33455398 1.04825733 -0.22106382
#> [15,] 1.8617319 1.34769126 0.88857811 1.67776862
#> [16,] 1.1614075 1.83998176 -0.03248675 0.17984142
#> [17,] 0.4440800 0.53911400 0.86916702 0.31147200
#> [18,] 1.4340379 0.82856395 -0.37695773 -0.94787253
#> [19,] 1.1712700 0.32028985 -0.41456531 -0.03970807
#> [20,] 0.4493721 0.29393898 1.53080765 0.06169887
#>
#>
#> $Predict
#> function (object, newpreds)
#> {
#> pred <- apply(newpreds, 1, function(x) mean(x, trim = object$Trim_Factor))
#> return(pred)
#> }
#> <bytecode: 0x56049daaf248>
#> <environment: namespace:ForecastComb>
#>
#> $Weights
#> [1] "Weights of the individual forecasts differ over time with trimmed mean"
#>
#> $Forecasts_Test
#> [1] 1.1525519 1.2193965 1.2434006 0.5508389 0.9994339 1.1314877 1.4431257
#> [8] 1.1597354 0.7394372 1.2114804 0.7980429 1.6627013 1.1846712 0.7763736
#> [15] 1.2037668 1.0965418 1.0462537 0.9307319 0.6355312 0.8102723
#>
#> $Accuracy_Test
#> ME RMSE MAE MPE MAPE
#> Test set -1.118448 1.364276 1.129985 102.8062 326.6335
#>
#> $Trim_Factor
#> [1] 0.1
#>
#> attr(,"class")
#> [1] "foreccomb_res"
## Algorithm-optimized trim factor:
data<-foreccomb(train_o, train_p, test_o, test_p)
comb_TA(data, criterion="RMSE")
#> Optimization algorithm chooses trim factor for trimmed mean approach...
#> Algorithm finished. Optimized trim factor: 0
#> $Method
#> [1] "Trimmed Mean"
#>
#> $Models
#> [1] "Series 1" "Series 2" "Series 3" "Series 4" "Series 5" "Series 6"
#> [7] "Series 7" "Series 8" "Series 9" "Series 10"
#>
#> $Fitted
#> Time Series:
#> Start = 1
#> End = 80
#> Frequency = 1
#> [1] 0.8405380 0.9382082 1.3892817 1.3156695 0.6471328 1.5941053 0.3820451
#> [8] 0.8801125 1.1717931 0.6424297 0.9023377 1.2320954 0.9386869 0.8564343
#> [15] 0.9298584 1.0170773 1.4013855 1.3902822 0.9648404 0.7412702 0.8277230
#> [22] 0.9181180 0.6287679 1.0734809 1.3364608 1.4417400 1.0245184 0.7409716
#> [29] 0.7365072 0.8068690 1.6607404 0.9865014 0.3350701 1.2792129 1.0388684
#> [36] 0.6792643 1.0386903 0.9943660 1.1129610 1.0272547 1.1665157 0.9978591
#> [43] 0.7269734 1.0668653 0.9851605 0.9318555 1.4101128 0.4455562 1.2321894
#> [50] 1.1949770 0.6801913 1.4197773 1.7562185 1.2071849 1.1664571 1.6104953
#> [57] 0.9832253 1.0785823 0.7956022 1.1570859 0.6557307 0.5322071 1.0568754
#> [64] 0.8830392 0.9250854 0.7490763 0.6263532 1.0091798 0.7956512 0.4793541
#> [71] 1.0141165 0.7743949 1.2239091 0.8873540 0.9979591 0.9833059 1.5517006
#> [78] 0.6581606 0.6647576 1.1796742
#>
#> $Accuracy_Train
#> ME RMSE MAE MPE MAPE ACF1 Theil's U
#> Test set -1.02729 1.314464 1.117106 164.1927 328.1222 -0.1400476 1.870272
#>
#> $Input_Data
#> $Input_Data$Actual_Train
#> Time Series:
#> Start = 1
#> End = 80
#> Frequency = 1
#> [1] -1.12023850 0.72812842 -1.22469330 0.80575706 -0.55979953 -0.35669315
#> [7] -1.49320292 -0.53923261 0.85872649 -1.00745112 -0.92233675 0.30379526
#> [13] 0.33000396 -0.80832967 -0.91868667 -0.26527531 1.03099672 -0.68352448
#> [19] -0.22649681 0.16996093 -0.72686555 0.78154113 -0.25901027 -0.51562993
#> [25] 0.35920891 -0.65506209 0.82451908 -2.24258789 0.92700850 -0.32961858
#> [31] 1.07310626 2.09001176 -0.78025595 0.95939569 0.76098539 0.37805308
#> [37] 0.49713458 -0.71677396 0.29118541 -1.31751275 0.98550032 0.82547334
#> [43] -0.90122912 -0.78791398 1.88151833 0.61894917 -0.76548873 -0.77354096
#> [49] -0.06727977 0.22156782 0.68812811 0.18016857 1.31596181 0.21298099
#> [55] 0.69276192 -0.02661631 0.20092330 -0.25920385 -1.18162464 -0.25328611
#> [61] -1.27922444 0.53499682 0.46395551 -0.83119159 0.39662959 1.27430483
#> [67] -0.56857131 -0.52702374 -0.64121262 -0.91254018 -0.07632995 0.06933154
#> [73] 0.24768030 0.14998107 1.86426491 0.92171508 -1.02865530 -0.31774937
#> [79] 0.16147636 -0.86861669
#>
#> $Input_Data$Forecasts_Train
#> Time Series:
#> Start = 1
#> End = 80
#> Frequency = 1
#> Series 1 Series 2 Series 3 Series 4 Series 5 Series 6
#> 1 1.67366932 0.03234905 1.102684857 2.5151592147 0.17008888 -0.40089345
#> 2 0.67997396 0.81701758 0.721478669 0.4618385970 0.70297031 0.43483948
#> 3 0.61337785 2.42278558 2.281219274 2.4685726548 0.79145165 0.61657268
#> 4 2.92423726 0.56668637 -0.785104024 2.8435568233 2.01475814 1.13178825
#> 5 1.59018091 2.27592162 -1.056482607 0.8681924321 0.21043983 0.03313741
#> 6 2.25251154 2.68066796 0.352650355 1.9579250613 1.09485218 1.03387859
#> 7 0.62446091 0.08436869 1.024385493 0.3833482992 -1.90610738 0.28176486
#> 8 0.46801665 1.69599387 0.452534954 2.2938156748 1.23672743 -1.32292469
#> 9 1.93755565 -1.12552096 -0.066994783 2.3045306766 3.09818648 0.97566103
#> 10 0.24862630 -0.40630228 0.532573537 1.7639029999 2.59406122 0.74834723
#> 11 -0.13453965 -0.63299655 1.387970369 0.8748380187 1.96860617 -0.37242917
#> 12 1.97224430 -0.49837354 0.879561850 1.7258584986 -0.06693445 1.71688767
#> 13 1.38299761 0.08617128 1.184151330 -0.2546572631 1.01686285 0.70988191
#> 14 0.78296746 -0.45539420 1.800746192 2.6168234105 0.63798745 0.67517631
#> 15 0.17597094 1.66844942 1.696938871 -0.1140685981 0.25387432 -1.43520246
#> 16 1.98517980 1.13480347 1.896975699 1.5071647308 -0.22963857 0.65760577
#> 17 0.99758654 2.48110602 3.313796972 0.0142234260 0.61736808 2.10227863
#> 18 0.87433193 2.19418763 1.700283976 2.1215480977 1.40557149 -0.05062992
#> 19 0.38505774 0.73978795 1.361441744 2.1507580810 0.12765418 1.05855288
#> 20 0.97483258 -0.15859133 -0.774914712 0.9346792361 1.09731305 0.22534059
#> 21 1.05214845 1.68226533 0.842714576 1.0823548325 1.56730658 0.95482448
#> 22 -0.06648854 0.52508544 -0.075750449 1.9902233761 1.12132279 1.51240807
#> 23 1.65829632 0.02005035 -0.302100942 1.6980403922 0.74772671 -0.44276646
#> 24 -0.13099495 1.60218975 0.166360774 2.1457288410 -0.52106847 2.18246138
#> 25 0.47163128 2.29858293 -0.298526483 0.5866604446 0.81769405 1.86189457
#> 26 1.78429447 0.98517710 2.854852533 1.2709174661 -0.32584228 0.47187518
#> 27 0.39481217 2.00487649 0.546468353 0.9952090628 -1.47207258 1.66308098
#> 28 -0.59921201 1.70129722 1.249990240 1.2037998077 -0.10250556 1.14991191
#> 29 0.85188814 2.42415145 2.366528446 1.2336084982 -0.20598172 0.69574184
#> 30 1.67493620 2.21215307 0.049483919 0.4822264290 0.84830192 -0.26277279
#> 31 0.93990608 1.33605518 0.138540049 1.0756345920 1.82029290 2.83592479
#> 32 2.37813880 1.73391059 -0.099409798 0.7804419606 -0.47370896 0.24012272
#> 33 0.02160552 0.32725434 0.799484413 0.3469453258 -0.41978943 1.44744894
#> 34 1.17534733 1.54575066 1.175986731 1.6211466000 1.47690540 0.47522554
#> 35 0.86541870 1.32876630 1.442959352 0.7458088494 0.65135642 1.82257751
#> 36 0.62657059 0.62827487 0.823734417 0.3285104828 0.22768478 0.80822550
#> 37 0.32509329 1.54194372 -0.290711683 1.4988684434 0.68207974 1.21177882
#> 38 1.78274447 1.60304233 1.295246916 0.0792628726 0.80860760 1.98117669
#> 39 1.61494497 1.20437204 1.676364715 0.6490247992 -0.15718040 1.49856900
#> 40 1.06287945 1.64309393 1.515547172 -0.7583774906 1.86130770 1.09385489
#> 41 0.41703833 -0.03414989 0.049508475 2.4385709498 3.12473426 0.96434352
#> 42 1.33556044 0.91561583 1.911637179 1.5186354681 -0.07777555 0.98893394
#> 43 -2.37646562 3.01172735 0.330554980 1.0505735665 0.38725857 -0.46200888
#> 44 1.14101201 0.11712143 0.836109393 2.4358637735 0.82087078 -0.04694651
#> 45 1.15701789 0.46698143 0.467913548 2.0566592454 1.70188751 1.83137561
#> 46 0.76208415 2.58505391 1.814709975 1.5914550443 0.19140828 1.54980184
#> 47 1.98379728 0.88502854 2.283488446 1.0081638912 2.43310911 2.72968791
#> 48 0.40599280 -0.58797717 -0.697303929 0.4837331523 1.88319566 2.00455677
#> 49 0.84045810 2.05672207 1.402257510 -0.5960420009 1.32177428 -0.34158575
#> 50 1.41396422 2.80234550 2.117110603 0.7227669538 2.38376397 1.46096556
#> 51 0.07104548 2.33565298 -0.779811958 0.6089289223 0.15849831 1.08255150
#> 52 0.90706273 1.93585060 0.587934960 1.5096274837 1.52348959 0.80293423
#> 53 3.27507175 1.66695230 0.533642112 1.8535018418 2.91706620 -0.46539695
#> 54 2.30770959 2.05527975 2.614276899 1.8668891006 -0.42578832 -0.54837246
#> 55 1.93205891 1.69310459 0.594401032 2.9257926775 1.58705697 1.45612091
#> 56 1.96244409 1.76406793 2.523654745 0.8175925352 1.10436711 1.59682732
#> 57 1.33693888 1.56460533 1.075137103 -0.8509415011 2.33975861 1.47008601
#> 58 -0.18177473 0.45288698 2.307065171 1.3980063472 0.21060218 2.09989528
#> 59 0.26618109 -0.42816114 2.422462716 1.5578083664 -0.19733639 0.59669296
#> 60 0.63665050 0.68637264 -0.034247027 2.6973440728 0.70778524 1.06699509
#> 61 0.53838099 1.16831184 0.357739312 0.4484154147 -0.31992478 0.56405267
#> 62 -0.39659895 -0.23171518 0.084855495 -0.6075298297 0.76969478 -0.40833533
#> 63 2.17893789 1.10841232 0.557768774 2.9958100538 -0.31881699 0.87357931
#> 64 1.69852004 1.07098358 -0.156778015 0.7217591349 2.31806573 0.51856383
#> 65 1.10438536 0.46358294 -0.177649425 -0.5627568123 1.19518256 1.19465503
#> 66 -0.60823744 0.63678182 -0.129922881 3.5009086798 0.63971230 0.70213496
#> 67 1.28981184 0.28621699 0.364951490 1.7562429765 -0.01850383 1.94078573
#> 68 2.23888918 -1.72828459 1.174857311 1.1934600449 0.70328697 2.91788128
#> 69 1.51788449 2.90894106 -1.670292627 0.9380951848 1.69673739 0.73973780
#> 70 0.43826679 -1.00823425 -0.008239596 0.5890198516 1.93211169 -0.86320058
#> 71 1.36541709 0.87323776 1.731359746 0.5532699100 0.20299516 1.09754468
#> 72 0.58345485 2.06607752 1.843862441 1.8551239654 -0.14973981 1.33449978
#> 73 0.48206198 0.34393063 0.337299144 2.6209202685 1.84446150 2.20804033
#> 74 2.25170368 0.78906592 -0.622445587 0.8343509025 -0.41873899 2.12299316
#> 75 0.10437819 -0.27149248 0.338439915 0.0007931688 0.69804243 3.24252223
#> 76 1.73204920 1.13214515 1.352115296 0.8989827413 -0.16141940 1.17863136
#> 77 0.85551649 3.19911368 0.490812634 0.0746984075 2.27893292 1.88764621
#> 78 2.01379797 1.99638094 1.064849838 -1.4788065366 0.35503075 0.59479018
#> 79 -0.39651750 1.60969853 0.178052596 -0.7202249717 -0.53999488 2.36407531
#> 80 0.25095943 1.87283676 2.345682116 1.4232762378 2.91147039 1.86588489
#> Series 7 Series 8 Series 9 Series 10
#> 1 1.580025619 0.43147613 0.400291145 0.900529275
#> 2 1.409112352 0.77453610 2.078919611 1.301395512
#> 3 1.413669217 1.16780351 0.256209227 1.861154931
#> 4 1.729224076 0.65010661 0.448784124 1.632657373
#> 5 -1.559899657 0.51583125 2.565669625 1.028337053
#> 6 2.047715195 -0.17614705 2.643443601 2.053555618
#> 7 0.981880079 2.33526740 -0.347042396 0.358125265
#> 8 1.972782664 1.98865980 0.093099169 -0.077580437
#> 9 1.788546374 1.29524300 0.221587172 1.289136060
#> 10 0.595692220 0.56609373 -0.763579234 0.544881243
#> 11 1.188928759 1.69466644 1.530295023 1.518037139
#> 12 1.436695488 3.45739094 -0.317737582 2.015360538
#> 13 1.336395058 2.76900840 -0.479934985 1.635992918
#> 14 0.839626301 0.79698521 -0.603932882 1.473358074
#> 15 1.777769459 2.06286151 0.736053322 2.475937145
#> 16 2.621728690 -1.06391789 0.570484010 1.090387503
#> 17 0.842820981 0.29549223 3.185793373 0.163388524
#> 18 2.162226515 1.27688544 1.577408836 0.641008226
#> 19 0.927655603 -0.09307450 1.217047141 1.773523185
#> 20 0.732517689 2.03443624 -1.157282962 3.504371137
#> 21 0.211162980 0.09143913 0.731963476 0.061050497
#> 22 0.635672889 0.58318832 2.796722157 0.158795461
#> 23 0.115941817 1.00363531 1.983184225 -0.194329173
#> 24 0.582162516 3.50001038 1.579957792 -0.371998941
#> 25 0.667525027 4.24666055 2.148086731 0.564398702
#> 26 3.677226489 1.24648278 1.574006587 0.878409764
#> 27 1.542975629 1.64824176 0.973216990 1.948374990
#> 28 -0.001598207 -0.61693138 1.515181806 1.909781882
#> 29 0.366781761 0.08228873 0.230365499 -0.680300780
#> 30 0.855630793 0.79010832 0.960596095 0.458025776
#> 31 2.939940482 1.54419386 2.032754135 1.944162377
#> 32 0.979179952 1.85815074 1.176415392 1.291772831
#> 33 0.133463005 2.53040119 -0.595500576 -1.240611942
#> 34 1.236081213 2.08779151 -0.268293537 2.266188007
#> 35 1.776289686 0.43001516 0.218055650 1.107436233
#> 36 0.466369297 0.19052971 0.666392882 2.026349990
#> 37 2.322045378 0.95977717 0.751491546 1.384536572
#> 38 -1.037137669 0.91768081 1.118750357 1.394285716
#> 39 0.998788857 0.65764817 1.612676177 1.374401922
#> 40 0.901237242 1.33261658 0.174757900 1.445629202
#> 41 2.113623613 0.28755604 0.678753029 1.625178927
#> 42 1.107543639 1.06490998 1.323464024 -0.109933771
#> 43 0.864046824 1.54800052 2.152478487 0.763568101
#> 44 1.334592870 0.53147706 1.484801782 2.013750019
#> 45 1.714411420 0.11324482 0.920501649 -0.578387726
#> 46 -0.473921651 0.65413353 -0.444562780 1.088393130
#> 47 0.474381650 0.58084743 1.712829515 0.009794148
#> 48 0.049667741 0.85771683 0.620799925 -0.564820182
#> 49 3.619953052 1.64294349 1.399063576 0.976349977
#> 50 -1.545738756 1.13419817 0.783410558 0.676983555
#> 51 -0.015943861 0.22799304 1.081762635 2.031236011
#> 52 1.919797712 1.65080793 1.412569247 1.947698094
#> 53 1.001315725 0.88567783 1.883443662 4.010910337
#> 54 1.076099838 -0.33967694 0.871172663 2.594259096
#> 55 1.085379708 1.57478639 -0.197868187 -0.986262262
#> 56 1.818427695 1.45534150 2.166501380 0.895728792
#> 57 1.561691934 0.30907371 0.338131915 0.687771240
#> 58 1.287403159 0.58569876 1.630162743 0.995877122
#> 59 2.392526865 0.27624513 1.074367279 -0.004765324
#> 60 2.585910447 2.36661583 1.918495053 -1.061062908
#> 61 1.179548509 0.18877460 1.171567445 1.260440708
#> 62 1.230342073 2.38615495 0.852305913 1.642897226
#> 63 1.298122729 -0.52609651 0.615097954 1.785938873
#> 64 1.737037882 -0.12174656 0.327720123 0.716266155
#> 65 2.742294250 1.30433099 -0.033270727 2.020100154
#> 66 1.527161445 0.29652585 1.179614237 -0.253916257
#> 67 0.414198838 -0.68940352 0.968354959 -0.049123710
#> 68 0.668013999 2.92834184 0.587837292 -0.592485298
#> 69 0.480027222 -0.02516995 1.503299565 -0.132747980
#> 70 0.782270570 2.17166762 0.807172366 -0.047293137
#> 71 0.439848056 1.14119727 1.298831647 1.437463684
#> 72 0.616085350 0.05878432 0.886268452 -1.350467860
#> 73 2.282069858 1.00293735 0.833228409 0.284141507
#> 74 1.480804365 0.56132180 0.169735324 1.704749463
#> 75 0.790705351 1.91299154 3.374420511 -0.211209759
#> 76 0.478100463 1.81028184 -0.251761619 1.663934106
#> 77 0.262973836 1.89102529 1.985352120 2.590934293
#> 78 1.269134458 0.96725294 -0.506543666 0.305719591
#> 79 2.104360676 1.38746904 0.008006697 0.652650233
#> 80 0.938653232 -1.11939189 -0.279286707 1.586657959
#>
#> $Input_Data$Actual_Test
#> [1] -0.64932563 0.50611644 0.81203774 -0.85999712 0.25865787 -1.09537361
#> [7] 0.68220772 -0.92065633 -0.17355934 -0.45686399 0.84063980 0.38759957
#> [13] -0.06889376 0.05666342 0.83263032 -1.67775354 -0.91896494 -0.42644707
#> [19] 0.70829920 0.78979415
#>
#> $Input_Data$Forecasts_Test
#> Series 1 Series 2 Series 3 Series 4 Series 5 Series 6
#> [1,] -0.2385209 2.6851917 1.7453790 0.22843982 2.534299727 1.915705701
#> [2,] 0.5249309 1.1520799 1.5808736 1.58425017 0.947530229 -0.581166208
#> [3,] 0.7686324 1.3622033 1.3660068 0.14195706 1.347658488 -0.007512494
#> [4,] 2.0152906 0.2916185 0.5349929 0.66084303 1.097984918 0.274999176
#> [5,] -1.4427914 1.8101231 1.2809614 3.59729840 2.058542056 0.888673119
#> [6,] 1.4794580 2.9930085 0.3875704 2.33299054 0.425449686 0.299506326
#> [7,] 0.6237780 2.2194276 0.6386271 3.79171066 1.177899539 2.466300479
#> [8,] 2.0853976 0.7093061 2.2906456 2.48485684 1.127404318 0.149359423
#> [9,] 0.7346899 1.5795645 2.0465569 0.98497985 -0.003166999 1.274398998
#> [10,] 2.3000687 2.7071646 0.7048814 0.40502586 3.282979314 0.825260671
#> [11,] -0.7514555 0.6526641 2.1661511 0.53391396 -0.653539999 1.636779368
#> [12,] 0.9180536 3.4607535 -0.4557291 1.10403282 2.658309217 1.077199750
#> [13,] 1.2570717 1.9030495 0.7592220 -0.07150113 0.811430378 1.872044020
#> [14,] 0.2734447 2.4997518 2.7541334 0.23862967 1.022196404 0.015218367
#> [15,] 2.6338353 -0.1551206 0.5031059 1.49612998 0.062723655 1.792404662
#> [16,] 1.3281506 1.4497524 0.9466572 1.18441011 0.682133411 1.944448452
#> [17,] -0.2263399 2.3619188 3.6662935 2.05653554 0.552730525 1.235011458
#> [18,] 2.7762135 -0.1120779 1.3369908 1.66543869 1.834644170 0.835215136
#> [19,] 1.0880103 1.3959128 3.5727052 -0.38351722 1.330353395 0.201638755
#> [20,] 0.4920097 1.1378751 1.7912296 1.32907362 0.648367791 0.600733522
#> Series 7 Series 8 Series 9 Series 10
#> [1,] -0.3956995 1.37407379 -0.30568465 1.96672309
#> [2,] 2.0047311 -0.03300400 1.99378023 2.06586426
#> [3,] 2.2589977 1.09796108 1.99324807 1.86953724
#> [4,] 0.2374274 -0.02496359 -0.51917187 1.33380886
#> [5,] 1.7908030 0.56117729 -0.32158455 -0.07322391
#> [6,] 1.1807577 1.57675960 -0.41818523 1.36940910
#> [7,] 0.4383561 0.92449115 1.45608026 2.03840159
#> [8,] -0.2025868 -0.18094510 1.35737236 1.73934300
#> [9,] 0.6620187 -1.18033207 0.82107955 -0.13806651
#> [10,] 1.1629113 -0.22510716 0.01300418 1.57352639
#> [11,] 1.2605888 0.96931935 0.62941535 1.35520261
#> [12,] 2.0587246 2.84175950 -0.16385219 2.80738308
#> [13,] 1.7541318 0.31309164 0.80732829 2.60961469
#> [14,] -0.5883313 1.33455398 1.04825733 -0.22106382
#> [15,] 1.8617319 1.34769126 0.88857811 1.67776862
#> [16,] 1.1614075 1.83998176 -0.03248675 0.17984142
#> [17,] 0.4440800 0.53911400 0.86916702 0.31147200
#> [18,] 1.4340379 0.82856395 -0.37695773 -0.94787253
#> [19,] 1.1712700 0.32028985 -0.41456531 -0.03970807
#> [20,] 0.4493721 0.29393898 1.53080765 0.06169887
#>
#>
#> $Predict
#> function (object, newpreds)
#> {
#> pred <- apply(newpreds, 1, function(x) mean(x, trim = object$Trim_Factor))
#> return(pred)
#> }
#> <bytecode: 0x56049daaf248>
#> <environment: namespace:ForecastComb>
#>
#> $Weights
#> [1] "Weights of the individual forecasts differ over time with trimmed mean"
#>
#> $Forecasts_Test
#> [1] 1.1509908 1.1239870 1.2198690 0.5902830 1.0149978 1.1626724 1.5775072
#> [8] 1.1560153 0.6781723 1.2749715 0.7799039 1.6306635 1.2015483 0.8376790
#> [15] 1.2108849 1.0684296 1.1809983 0.9274196 0.8242390 0.8335107
#>
#> $Accuracy_Test
#> ME RMSE MAE MPE MAPE
#> Test set -1.140897 1.380541 1.14697 97.3022 333.5354
#>
#> $Trim_Factor
#> [1] 0
#>
#> attr(,"class")
#> [1] "foreccomb_res"