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\)
- 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 treeexperiment (
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
-
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 treeexperiment (
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_depth- Return type
-
idpflex.bayes.model_at_depth(tree, depth, property_name)[source]¶ Generate a fit model at a particular tree depth
- Parameters
tree (
Tree) – Hierarchical treedepth (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 background- Return type
-
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 hierarchicalTreeproperty_name (str) – Name of the property to create the model for
- Returns
A model composed of a
TabulatedFunctionModeland aConstantModel- Return type