Fitting f(x) = sin(x)*sin(x) with LinearCombinationFunc()

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?

I have no experience with this function, but “linear combination” does not sound like an operation that will do the left/right shift you need to match the phase.

You might try the CurvFunc option with three variables:

Non-linear least-squares fitting the points (x,y) to an arbitrary function y : x -> f(p0, p1, p2, x), returning a function y’ for the best fitting curve.

That would allow a model of the form y = a + b*sin(x+c);