Skip to content

Commit e104303

Browse files
Jammy2211Jammy2211
authored andcommitted
add model centred to autofit result
1 parent 5c6d71a commit e104303

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

autofit/non_linear/result.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,29 @@ def instance(self):
123123
def max_log_likelihood_instance(self):
124124
return self.instance
125125

126+
@property
127+
def model_centred(self) -> AbstractPriorModel:
128+
"""
129+
Returns a model where every free parameter is a `GaussianPrior` with `mean` the previous result's
130+
inferred maximum log likelihood parameter values and `sigma` the input absolute value `a`.
131+
132+
For example, a previous result may infer a parameter to have a maximum log likelihood value of 2.
133+
134+
If this result is used for search chaining, `model_centred_absolute(a=0.1)` will assign this free parameter
135+
`GaussianPrior(mean=2.0, sigma=0.1)` in the new model, where `sigma` is linked to the input `a`.
136+
137+
Parameters
138+
----------
139+
a
140+
The absolute width of gaussian priors
141+
142+
Returns
143+
-------
144+
A model mapper created by taking results from this search and creating priors with the defined absolute
145+
width.
146+
"""
147+
return self.samples_summary.model_centred
148+
126149
def model_centred_absolute(self, a: float) -> AbstractPriorModel:
127150
"""
128151
Returns a model where every free parameter is a `GaussianPrior` with `mean` the previous result's

0 commit comments

Comments
 (0)