comet_maths.generate_sample.generate_sample.generate_sample#
- comet_maths.generate_sample.generate_sample.generate_sample(MCsteps, x, u_x, corr_x=None, 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.
- Parameters:
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] or array or str, optional) – (list of) correlation matrices (n,n). This keyword must be set unless x and u_x are a single number.
i (int, optional) – 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