Fitting Result

class eddington.fitting_result.FittingResult(a0: Union[List[float], <sphinx.ext.autodoc.importer._MockObject object at 0x7fb3a8138fd0>], a: Union[List[float], <sphinx.ext.autodoc.importer._MockObject object at 0x7fb3a81370d0>], aerr: Union[List[float], <sphinx.ext.autodoc.importer._MockObject object at 0x7fb3a8137190>], acov: Union[List[List[float]], <sphinx.ext.autodoc.importer._MockObject object at 0x7fb3a8137450>], degrees_of_freedom: int, chi2: float, precision: int = 3)

Dataclass that contains the relevant parameters returned by a fitting algorithm.

Parameters:
  • a0 (list of floats or np.ndarray) – The initial guess for the fitting function parameters.
  • a (list of floats or np.ndarray) – The result for the fitting parameters.
  • aerr (list of floats or np.ndarray) – Estimated errors of a.
  • arerr (list of floats or np.ndarray) – Estimated relative errors of a (equivalent to aerr/a).
  • acov (list of lists of floats or np.ndarray) – Covariance matrix of a.
  • degrees_of_freedom (int) – How many degrees of freedom of the fittings.
  • chi2 (float) – Optimization evaluation for the fit.
  • chi2_reduced (float) – Reduced chi2.
  • p_probability (float) – P-probability (p-value) of the fitting, evaluated from chi2_reduced.
json_string

Json representation string.

Returns:self representing json string
Return type:str
precision = 3
pretty_string

Pretty representation string.

Returns:self representing pretty string
Return type:str
save_json(file_path: Union[str, pathlib.Path]) → None

Write the result to a json file.

Parameters:file_path (str or Path) – Path to write the result in. if None, prints to console.
save_txt(file_path: Union[str, pathlib.Path]) → None

Write the result to a text file.

Parameters:file_path (str or Path) – Path to write the result in. if None, prints to console.