satlas.models.basemodel.BaseModel

class satlas.models.basemodel.BaseModel[source]

Abstract baseclass for all models. For input, see these classes.

__init__()[source]
get_result(selection='any')[source]

Return the variable names, values and estimated error bars for the parameters as seperate lists.

Parameters:selection (string, optional) – Selects if the chisquare (‘chisquare’ or ‘any’) or MLE values are used. Defaults to ‘any’.
Returns:names, values, uncertainties – Returns a 3-tuple of lists containing the names of the parameters, the values and the estimated uncertainties.
Return type:tuple of lists
get_result_dict(method='chisquare', scaled=False)[source]

Returns the fitted parameters in a dictionary of the form {name: [value, uncertainty]}.

Parameters:
  • method ({'chisquare', 'mle'}) – Selects which parameters have to be returned.
  • scaled (boolean) – Selects if, in case of chisquare parameters, the uncertainty has to be scaled by sqrt(reduced_chisquare). Defaults to False.
Returns:

Dictionary of the form described above.

Return type:

dict

get_result_frame(method='chisquare', selected=False, bounds=False, vary=False, scaled=False)[source]

Returns the data from the fit in a pandas DataFrame.

Parameters:
  • method (str, optional) – Selects which fitresults have to be loaded. Can be ‘chisquare’ or ‘mle’. Defaults to ‘chisquare’.
  • selected (list of strings, optional) – Selects the parameters that have any string in the list as a substring in their name. Set to None to select all parameters. Defaults to None.
  • bounds (boolean, optional) – Selects if the boundary also has to be given. Defaults to False.
  • vary (boolean, optional) – Selects if only the parameters that have been varied have to be supplied. Defaults to False.
  • scaled (boolean, optional) – Sets the uncertainty scaling with the reduced chisquare value. Default to False.
Returns:

resultframe – Dateframe with MultiIndex, using the variable names as main column names and either two subcolumns for the value and the uncertainty, or four subcolumns for the value, uncertainty and bounds.

Return type:

DataFrame

Methods

__init__()
display_chisquare_fit([scaled]) Display all relevent info of the least-squares fitting routine, if this has been performed.
display_mle_fit([scaled]) Give a readable overview of the result of the MLE fitting routine.
get_chisquare_mapping()
get_lnprior_mapping(params)
get_result([selection]) Return the variable names, values and estimated error bars for the parameters as seperate lists.
get_result_dict([method, scaled]) Returns the fitted parameters in a dictionary of the form {name: [value, uncertainty]}.
get_result_frame([method, selected, bounds, ...]) Returns the data from the fit in a pandas DataFrame.
save(path) Saves the current spectrum, including the results of the fitting and the parameters, to the specified file.
seperate_response(x) Wraps the output of the __call__ in a list, for ease of coding in the fitting routines.
set_boundaries(boundaryDict) Sets the boundaries of the fitparameters as supplied in the dictionary.
set_chisquare_mapping(mappingDict) Sets the prior mapping for the different parameters.
set_expr(exprDict) Sets the expression of the selected parameters to the given expressions.
set_literature_values(literatureDict) Sets the lnprior and chisquare mapping to handle the given literature values and uncertainties.
set_lnprior_mapping(mappingDict) Sets the prior mapping for the different parameters.
set_value(valueDict) Sets the value of the given parameters to the given values.
set_variation(varyDict) Sets the variation of the fitparameters as supplied in the dictionary.

Previous topic

API reference

Next topic

satlas.models.summodel.SumModel

This Page