bayes : Fit simulated profiles against experiment¶
-
class
idpflex.bayes.TabulatedFunctionModel(xdata, ydata, interpolator_kind='linear', prefix='', missing=None, name=None, **kwargs)[source]¶ Bases:
lmfit.model.ModelA fit model that uses a table of (x, y) values to interpolate
Uses
interp1d- Fitting parameters:
- integrated intensity
amplitude\(A\) - position of the peak
center\(E_0\) - nominal relaxation time
tau\(\tau\) - stretching exponent
beta\(\beta\)
- integrated intensity
Parameters:
-
idpflex.bayes.fit_at_depth(tree, experiment, property_name, depth)[source]¶ Fit at a particular tree depth from the root node
Fit experiment against the property stored in the nodes. The fit model is generated by
model_at_depth()Parameters: - tree (
Tree) – Hierarchical tree - experiment (
ProfileProperty) – A property containing the experimental info. - property_name (str) – The name of the simulated property to compare against experiment
- max_depth (int) – Fit at each depth up to (and including) max_depth
Returns: Results of the fit
Return type: - tree (
-
idpflex.bayes.fit_to_depth(tree, experiment, property_name, max_depth=5)[source]¶ Fit at each tree depth from the root node up to a maximum depth
Fit experiment against the property stored in the nodes. The fit model is generated by
model_at_depth()Parameters: - tree (
Tree) – Hierarchical tree - experiment (
ProfileProperty) – A property containing the experimental info. - property_name (str) – The name of the simulated property to compare against experiment
- max_depth (int) – Fit at each depth up to (and including) max_depth
Returns: A list of
ModelResultitems containing the fit at each level of the tree up to and including max_depthReturn type: list- tree (
-
idpflex.bayes.model_at_depth(tree, depth, property_name)[source]¶ Generate a fit model at a particular tree depth
Parameters: - tree (
Tree) – Hierarchical tree - depth (int) – depth level, starting from the tree’s root (depth=0)
- property_name (str) – Name of the property to create the model for
Returns: A model composed of a
TabulatedFunctionModelfor each node plus aConstantModelaccounting for a flat backgroundReturn type: - tree (
-
idpflex.bayes.model_at_node(node, property_name)[source]¶ Generate fit model as a tabulated function with a scaling parameter, plus a flat background
Parameters: - node (
ClusterNodeX) – One node of the hierarchicalTree - property_name (str) – Name of the property to create the model for
Returns: A model composed of a
TabulatedFunctionModeland aConstantModelReturn type: - node (