This Python script smooths out noisy one-dimensional data by optimizing a cost function that has two competing parts. The terms are
- The square difference between the smooth model and the input data.
- The square difference between the derivative of the smooth model at each input data point.
The competition is quantified by a smoother coefficient multiplying the derivative term. For a smoother cost function, the model will typically pull away from the noisy data and look smoother. However, this is typically at the cost (:grin:) of being a poorer fit to the numerical/experimental data.
Here I clarify some of the terminology I use in the repo:
input
: the arugment (x-axis) of the data set used. This is never modified.data
: the numerical or experimental values (y-axis) in the data set used. This is also never modified.model
: this is the modified set of data. The model is of identicalshape
to thedata
, and its values are iteratively updated to satisfy the cost function.