@@ -273,47 +273,17 @@ def compute_density_BMTI(
273
273
delta_F_inv_cov = "uncorr" ,
274
274
comp_log_den_err = False ,
275
275
mem_efficient = False ,
276
- ):
277
- """Compute the log-density for each point using BMTI
278
-
279
- Args:
280
- delta_F_inv_cov (str): see compute_density_BMTI_reg docs.
281
- comp_log_den_err (bool): see compute_density_BMTI_reg docs.
282
- mem_efficient (bool): see compute_density_BMTI_reg docs.
283
-
284
- """
285
-
286
- # call compute_density_BMTI_reg with alpha=1 and log_den and log_den_err as arrays of ones
287
- self .compute_density_BMTI_reg (
288
- alpha = 1.0 ,
289
- log_den = np .ones (self .N ),
290
- log_den_err = np .ones (self .N ),
291
- delta_F_inv_cov = delta_F_inv_cov ,
292
- comp_log_den_err = comp_log_den_err ,
293
- mem_efficient = mem_efficient ,
294
- )
295
-
296
- # ----------------------------------------------------------------------------------------------
297
-
298
- def compute_density_BMTI_reg (
299
- self ,
300
- alpha = 0.1 ,
276
+ alpha = 1 ,
301
277
log_den = None ,
302
278
log_den_err = None ,
303
- delta_F_inv_cov = "uncorr" ,
304
- comp_log_den_err = False ,
305
- mem_efficient = False ,
306
279
):
307
- """Compute the log-density for each point using BMTI plus kstarNN estimator as a regulariser .
280
+ """Compute the log-density for each point using BMTI.
308
281
309
- The regulariser log-density and its errors can be passed as arguments: log_den and log_den_err. If any of these
310
- two is not specified, use kstarNN estimator as a regulariser.
282
+ If alpha<1, the algorithm also includes a regularisatin. The regulariser log-density and its errors can be
283
+ passed as arguments: log_den and log_den_err. If any of these two is not specified, use kstarNN estimator
284
+ as a regulariser.
311
285
312
286
Args:
313
- alpha (float): can take values from 0.0 to 1.0. Indicates the portion of BMTI in the sum of the likelihoods
314
- alpha*L_BMTI + (1-alpha)*L_kstarNN. Setting alpha=1.0 corresponds to not reguarising BMTI.
315
- log_den (np.ndarray(float)): size N. The array of the log-densities of the regulariser.
316
- log_den_err (np.ndarray(float)): size N. The array of the log-density errors of the regulariser.
317
287
delta_F_inv_cov (str): specify the method used to invert the cross-covariance matrix C of the log-density
318
288
deviations cov[deltaF_ij,deltaF_kl]. Currently implemented methods:
319
289
"uncorr" (default): all the deltaFs are assumed uncorrelated, i.e. C is assumed to be diagonal with
@@ -326,6 +296,10 @@ def compute_density_BMTI_reg(
326
296
comp_log_den_err (bool): if True, compute the error on the BMTI estimates. Can be highly time consuming
327
297
mem_efficient (bool): if True, use a sparse matrice to solve BMTI linear system (slower). If False, use a
328
298
dense NxN matrix; this is faster, but can require a great amount of memory if the system is large.
299
+ alpha (float): can take values from 0.0 to 1.0. Indicates the portion of BMTI in the sum of the likelihoods
300
+ alpha*L_BMTI + (1-alpha)*L_kstarNN. Setting alpha=1.0 corresponds to not reguarising BMTI.
301
+ log_den (np.ndarray(float)): size N. The array of the log-densities of the regulariser.
302
+ log_den_err (np.ndarray(float)): size N. The array of the log-density errors of the regulariser.
329
303
330
304
"""
331
305
0 commit comments