Consider the scenario where the aim is to fit a lorenzian function to a
1D dataset but a constraint applied on the peak centre parameter. Assume
the 1D dataset consists of data points
, where
is the ith x-value and
is the ith observed
value for that x-value. Write the lorentzian function as:
where he lorentzian fitting parameters here are
is the x-value of the ith data point and
is the lorentzian calculated value at that data point.
We want to apply a constraint on the x0 parameter, i.e. the centre of
the peak. For example, apply the constraint that should be in
between
and
. If this is not satisfied
we then add the following penalty function to
if
:
where is a constant (default 1000) and
a spiky
function which takes the value 1 for the first and last data point and
for every 10th data point from the 1st data point, but is otherwise
zero. The penalty function when
takes the form:
.
If more than one constraint is defined, then for each violated constraint a penalty of the type defined above is added to the calculated fitting function.
Category: Concepts