Correlation for Sine Model?

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

User avatar
mathmannix
Posts: 1410
Joined: Fri Jul 06, 2012 2:12 pm UTC
Location: Washington, DC

Correlation for Sine Model?

Postby mathmannix » Tue Mar 03, 2015 4:13 pm UTC

I am trying to fit a monthly sine wave to data. For simplicity, I am using for each data point the average of the values on that day of the month, so I have 31 data points. I want the period to be 31. As a quick-and-dirty method, I am (for now) using the max value minus the min value as the amplitude, and the mean of the 31 values as the displacement, and so my model is

y = A * sin ( (2π/31) x + c) + μ,

where μ is the mean of all 31 values (I don't know how to make an x-bar symbol), and A = xmax - xmin. (c, which determines the phase shift (-31c/2π), is my variable which I am adjusting to find the best fit.)

My problem is trying to objectively compare how well the model fit different groups of data. I need a correlation coefficient, but R2 is only meaningful for linear regression.

I tried taking the arcsine of both my data and my model, in order to get a linear model, but I haven't gotten this to work, or at least to provide me with an R2 value that makes sense.

Can someone help, please?
I hear velociraptor tastes like chicken.

User avatar
doogly
Dr. The Juggernaut of Touching Himself
Posts: 5431
Joined: Mon Oct 23, 2006 2:31 am UTC
Location: Lexington, MA
Contact:

Re: Correlation for Sine Model?

Postby doogly » Tue Mar 03, 2015 4:51 pm UTC

The chi^2 is a good general choice.

Though is there very strong motivation for presetting things like the amplitude? Since you are picking that based on the max and min values, these two data points become extremely important in determining the form of your model. In general they should be given no more weight than any other data point in finding a functional form - and maybe the extreme values have reason to be *distrusted!*
LE4dGOLEM: What's a Doug?
Noc: A larval Doogly. They grow the tail and stinger upon reaching adulthood.

Keep waggling your butt brows Brothers.
Or; Is that your eye butthairs?

User avatar
mathmannix
Posts: 1410
Joined: Fri Jul 06, 2012 2:12 pm UTC
Location: Washington, DC

Re: Correlation for Sine Model?

Postby mathmannix » Tue Mar 03, 2015 5:57 pm UTC

Thanks! Pearson's chi-squared seems to be working out quite well for my purposes. (Like I said, my model is a quick-and-dirty one; the important thing is to have something which works to compare different groups of data. I can always change the parameters later to get even better-fitting models.)
I hear velociraptor tastes like chicken.

flownt
Posts: 70
Joined: Sat Feb 09, 2013 5:24 pm UTC

Re: Correlation for Sine Model?

Postby flownt » Thu Mar 05, 2015 7:00 am UTC

Typically one wants to find the maximum likelihood estimators. If your errors are Normal distributed then this is equivalent to finding those parameters that minimize the squared error. This suggests the root-mean-square error as a reasonable measure.


Return to “Mathematics”

Who is online

Users browsing this forum: No registered users and 9 guests