I am trying to fit f(x) = sin(x)*sin(x) function to my data like this:
Func<double, double> fit = Fit.LinearCombinationFunc( xData, yData, x => 1.0, x => Math.Pow(Math.Sin(x + 1.0), 2));
But the phase of “fit” is a bit off:
My data could have random phase shift every time a acquire it and that is the main problem with this fitting.
What I am doing wrong?