webbpsf_ext.maths.fit_bootstrap

webbpsf_ext.maths.fit_bootstrap(pinit, datax, datay, function, yerr_systematic=0.0, nrand=1000, return_more=False)[source]

Bootstrap fitting routine

Bootstrap fitting algorithm to determine the uncertainties on the fit parameters.

Parameters
  • pinit (ndarray) – Initial guess for parameters to fit

  • datax, datay (ndarray) – X and Y values of data to be fit

  • function (func) – Model function

  • yerr_systematic (float or array_like of floats) – Systematic uncertainites contributing to additional error in data. This is treated as independent Normal error on each data point. Can have unique values for each data point. If 0, then we just use the standard deviation of the residuals to randomize the data.

  • nrand (int) – Number of random data sets to generate and fit.

  • return_more (bool) – If true, then also return the full set of fit parameters for the randomized data to perform a more thorough analysis of the distribution. Otherewise, just reaturn the mean and standard deviations.