I would like to fit a cosine squared function to a set of points with known X and Y coordinates. The function should be A*cos^2(B+x), since the frequency is a known constant and the bias is zero (I'm searching for the values of A and B). I know of this solution for sine function: Math.Net Numerics - Fitting sinus function but I couldn't modify it to my needs (currently I'm using it to fit a sine and compute the cosine squared from that with trigonometric identities, but i don't think that's an ideal solution). Also I have very few points (usually 5 points, 120 degree distance between the X coordinates), does this change the fitting method I should use?
Asked
Active
Viewed 206 times
1
-
Can you show use what you tried? – Jeroen van Langen Feb 12 '19 at 10:00
-
Actually, I would have suggested to use the sine fit plus trigonometric identities. There is no reason why this should not work with standard error propagation. – mikuszefski Feb 13 '19 at 08:56