@@ -5,9 +5,11 @@ def getfcu(ghat, u):
55 idx = [s .u for s in ghat .settings ].index (u )
66 bws = ghat .settings [idx ].bandwidths
77
8- fcu = ghat [u ].reshape (bws [::- 1 ] - 1 )
9- fcu = np .permute_dims (fcu , range (len (bws ))[::- 1 ])
10-
8+ #fcu = ghat[u].reshape(bws[::-1] - 1)
9+ #fcu = np.permute_dims(fcu, range(len(bws))[::-1])
10+ fcu = ghat [u ].reshape (bws - 1 )
11+ fcu = np .permute_dims (fcu , range (len (bws )))
12+
1113 return fcu
1214
1315
@@ -30,7 +32,7 @@ def compute_bandwidth(B, D, t):
3032 us = set (D .keys ()) - {()}
3133 bw = {u : [6 ] * len (u ) for u in us }
3234 bw [()] = []
33-
35+
3436 minfreqs = sum (math .prod ((bw [u ][j ] - 1 ) for j in range (len (u ))) for u in us )
3537 if B < minfreqs :
3638 raise ValueError (f"Budget too small: { B } < { minfreqs } " )
@@ -156,19 +158,19 @@ def estimate_rates(self, lam, settingnr=None, verbose=False):
156158 )
157159
158160 if (idx is None ) or idx >= len (axissum ):
159- D [u ][len ( u ) - j - 1 ] = math .nan
160- t [u ][len ( u ) - j - 1 ] = math .nan
161+ D [u ][j ] = math .nan
162+ t [u ][j ] = math .nan
161163 else :
162164 idx = min (len (axissum ), len (axissum ) - idx + 2 )
163165 Duj , tuj = fitrate_log (np .cumsum ((axissum [0 :idx ])[::- 1 ])[::- 1 ])
164- D [u ][len ( u ) - j - 1 ] = Duj
165- t [u ][len ( u ) - j - 1 ] = - tuj / 2
166+ D [u ][j ] = Duj
167+ t [u ][j ] = - tuj / 2
166168
167169 if verbose :
168170 x = np .arange (1 , idx + 1 )
169171 ax .plot (
170172 x ,
171- D [u ][len ( u ) - j - 1 ] * x ** (- 2 * t [u ][len ( u ) - j - 1 ]),
173+ D [u ][j ] * x ** (- 2 * t [u ][j ]),
172174 linewidth = 2 ,
173175 # color=j
174176 )
0 commit comments