Vectorized weights_threedx()
Examples
threedx:::weights_threedx_vec(
alphas = c(0, 0.2, 0.5, 0.8, 1),
alphas_seasonal = c(0.1, 0.3, 0.55, 1, 0.25),
alphas_seasonal_decay = c(0.11, 0.01, 0.02, 0.05, 0.1),
n = 50,
period_length = 7
)
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 1.318203e-02 1.645697e-02 1.481128e-02 1.333015e-02 1.199713e-02
#> [2,] 4.232186e-06 7.633813e-06 6.679587e-06 5.844638e-06 5.114058e-06
#> [3,] 1.096958e-15 4.974865e-15 4.477378e-15 4.029640e-15 3.626676e-15
#> [4,] 0.000000e+00 3.232929e-30 0.000000e+00 0.000000e+00 0.000000e+00
#> [5,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [,6] [,7] [,8] [,9] [,10]
#> [1,] 1.199713e-02 1.333015e-02 1.481128e-02 1.849098e-02 1.664188e-02
#> [2,] 6.392573e-06 1.141531e-05 2.038448e-05 3.676854e-05 3.217248e-05
#> [3,] 7.253353e-15 3.223712e-14 1.432761e-13 6.497782e-13 5.848004e-13
#> [4,] 0.000000e+00 0.000000e+00 0.000000e+00 2.658659e-25 0.000000e+00
#> [5,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [,11] [,12] [,13] [,14] [,15]
#> [1,] 1.497769e-02 1.347992e-02 1.347992e-02 1.497769e-02 1.664188e-02
#> [2,] 2.815092e-05 2.463205e-05 3.079006e-05 5.498226e-05 9.818260e-05
#> [3,] 5.263204e-13 4.736883e-13 9.473767e-13 4.210563e-12 1.871361e-11
#> [4,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [5,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [,16] [,17] [,18] [,19] [,20]
#> [1,] 2.077638e-02 1.869874e-02 1.682887e-02 1.514598e-02 1.514598e-02
#> [2,] 1.770970e-04 1.549599e-04 1.355899e-04 1.186412e-04 1.483015e-04
#> [3,] 8.486899e-11 7.638210e-11 6.874389e-11 6.186950e-11 1.237390e-10
#> [4,] 2.186397e-20 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [5,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [,21] [,22] [,23] [,24] [,25]
#> [1,] 1.682887e-02 1.869874e-02 2.334425e-02 2.100982e-02 1.890884e-02
#> [2,] 2.648241e-04 4.729001e-04 8.529945e-04 7.463702e-04 6.530739e-04
#> [3,] 5.499511e-10 2.444227e-09 1.108493e-08 9.976437e-09 8.978793e-09
#> [4,] 0.000000e+00 0.000000e+00 1.798024e-15 0.000000e+00 0.000000e+00
#> [5,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [,26] [,27] [,28] [,29] [,30]
#> [1,] 1.701796e-02 1.701796e-02 1.890884e-02 2.100982e-02 2.622949e-02
#> [2,] 5.714397e-04 7.142996e-04 1.275535e-03 2.277741e-03 4.108479e-03
#> [3,] 8.080914e-09 1.616183e-08 7.183035e-08 3.192460e-07 1.447828e-06
#> [4,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 1.478638e-10
#> [5,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [,31] [,32] [,33] [,34] [,35]
#> [1,] 2.360654e-02 2.124589e-02 1.912130e-02 1.912130e-02 2.124589e-02
#> [2,] 3.594919e-03 3.145555e-03 2.752360e-03 3.440450e-03 6.143661e-03
#> [3,] 1.303045e-06 1.172740e-06 1.055466e-06 2.110933e-06 9.381923e-06
#> [4,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [5,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [,36] [,37] [,38] [,39] [,40]
#> [1,] 2.360654e-02 2.947134e-02 0.0265242075 0.0238717868 0.0214846081
#> [2,] 1.097082e-02 1.978864e-02 0.0173150624 0.0151506796 0.0132568447
#> [3,] 4.169743e-05 1.891040e-04 0.0001701936 0.0001531742 0.0001378568
#> [4,] 0.000000e+00 1.215985e-05 0.0000000000 0.0000000000 0.0000000000
#> [5,] 0.000000e+00 0.000000e+00 0.0000000000 0.0000000000 0.0000000000
#> [,41] [,42] [,43] [,44] [,45] [,46]
#> [1,] 0.0214846081 0.023871787 0.026524208 0.03311387 0.02980248 0.02682223
#> [2,] 0.0165710558 0.029591171 0.052841377 0.09531273 0.08339864 0.07297381
#> [3,] 0.0002757136 0.001225394 0.005446196 0.02469930 0.02222937 0.02000643
#> [4,] 0.0000000000 0.000000000 0.000000000 0.99998784 0.00000000 0.00000000
#> [5,] 0.0000000000 0.000000000 0.000000000 0.00000000 0.00000000 0.00000000
#> [,47] [,48] [,49] [,50]
#> [1,] 0.02414001 0.02414001 0.02682223 0.02980248
#> [2,] 0.06385208 0.07981510 0.14252697 0.25451245
#> [3,] 0.01800579 0.03601158 0.16005146 0.71133982
#> [4,] 0.00000000 0.00000000 0.00000000 0.00000000
#> [5,] 0.00000000 0.00000000 0.00000000 1.00000000