paramagpy.fit.fit_error_bootstrap

paramagpy.fit.fit_error_bootstrap(fittingFunction, iterations, fraction, **kwargs)[source]

Perform uncertainty analysis sourcing noise from fractioning the experimental data. This function takes a fitting routine <fittingFunction> and repeats it for the specified iterations in a Bootstrap approach. With each iteration, a random subset of the experimental data is sampled as specified by the <fraction> argument. The standard deviation in the fitted parameters is then returned.

Parameters
  • fittingFunction (function) – the fitting routine to be used. This could be ‘nlr_fit_metal_from_ccr’ for example

  • iterations (int) – the number of iterations for the Monte-Carlo simulation

  • fraction (float) – the proportion of data to be samples. Must be between 0 and 1.0

  • kwargs (dict) – all key-word arguments will be bundled into this variable and parsed to the fittingFunction.

Returns

  • sample_metals (list of list of metals) – the metals fitted to the data with noise at each iteration

  • std_metals (list of metals) – the standard deviation in fitted parameters over all iterations of the Monte Carlo simulation. These are stored within the metal object. All unfitted parameters are zero.