comet_maths.generate_sample.generate_sample.generate_sample_correlated

comet_maths.generate_sample.generate_sample.generate_sample_correlated#

comet_maths.generate_sample.generate_sample.generate_sample_correlated(MCsteps, x, u_x, corr_x, i=None, dtype=None, pdf_shape='gaussian', pdf_params=None, comp_list=False)[source]#

Generate correlated MC sample of input quantity with given uncertainties and correlation matrix. sample are generated using generate_sample_cov() after matching up the uncertainties to the right correlation matrix. It is possible to provide one correlation matrix to be used for each measurement (which each have an uncertainty) or a correlation matrix per measurement.

Parameters:
  • MCsteps (int) – number of MC steps

  • x (list[array]) – list of input quantities (usually numpy arrays)

  • u_x (list[array]) – list of uncertainties/covariances on input quantities (usually numpy arrays)

  • corr_x (list[array]) – list of correlation matrices (n,n) along non-repeating axis, or list of correlation matrices for each repeated measurement.

  • i (int) – index of the input quantity (in x)

  • dtype (numpy.dtype, optional) – dtype of the produced sample

  • pdf_shape (str, optional) – string identifier of the probability density function shape, defaults to gaussian

  • pdf_params (dict, optional) – dictionaries defining optional additional parameters that define the probability density function, Defaults to None (gaussian does not require additional parameters)

  • comp_list (bool, optional) – boolean to define whether u_x and corr_x are given as a list or individual uncertainty components. Defaults to False, in chich case a single combined uncertainty component is given per input quantity.

Returns:

generated sample

Return type:

array