nustattools.robust package

Module contents

Copyright (c) 2024 Lukas Koch. All rights reserved.

Tools for robust statistical treatments, e.g. when dealing with unknown covariances.

nustattools.robust.derate_covariance(cov, *, jacobian=None, sigma=3.0, accuracy=0.01)[source]

Derate the covariance of some data to account for unknown correaltions.

See TODO: Ref to paper.

Parameters:
  • cov (numpy.ndarray or list of numpy.ndarray) – The covariance matrix of the data or a list of covariances that add up to the total. Unknown covariances must be np.nan.

  • jacobian (numpy.ndarray, default=None) – Jacobian matrix of the model prediction wrt to the best-fit parameters.

  • sigma (float, default=3.) – The desired confidence level up to which the derated covariance should be conservative, expressed in standard-normal stadard deviations. E.g. sigma=3. corresponds to CL=0.997.

  • accuracy (float, default=0.01) – The derating factor is calculated using numerical sampling. This parameter determines how many samples to throw. Lower values mean more samples.

Returns:

a – The derating factor for the total covariance.

Return type:

float