- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
analysis of fit to cosine wave
I am planning to analyze circadian rhythm data and can fit it to the Savitzky-Golan smoother with a cubic degree and local cosine weighting. This provides a visual with a confidence of fit. However, is there a way to statistically determine the quality of the fit to the cosine waveform? I have tried saving the smoother formula to the data table then launching the analysis using the upper and lower smoother values in a Sheffe Cubic macro with the x-time covariant but I am not sure if this is the best way to analyze fit. Any advice?
Thanks,
Arthur DeCarlo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: analysis of fit to cosine wave
Hi @aadecarlojr ,
I think the following is one possible approach that you could take.
What I've done is generate a column of values :t and another column called :M M is a function of :t, namely:
As you pointed out, in Graph Builder, you can use the Savitzky-Golay smoother to fit functions like this. I have also used the cubic degree and local cosine weighting by using the options in the red hot button menu net to "Smoother". One thing you can also do is "Save Formula",
Which, in my case, saves the following column :Smoother(M) to the data table with the following formula:
You can then proceed to do a Fit Y by X, where you use the actual data as the Y variable and the predicted data as the X, and then fit a line to the data. This will give you some fit statistics and basis to quantify how good of a fit you actually have.
In my case, you can see the fit does very well, with an r^2 of 0.97. In addition to getting this fit statistic, you can also save the 95% confidence interval on the fit by clicking the red hot button next to Linear Fit and selecting Indiv Confidence Limit Formula.
This will save two additional columns to the data table that you can then use in an overlay plot to see how well the fit and actual data stay within the 95% confidence intervals, see below.
This should at least get you started on being able to quantify the fit of your data.
Hope this helps!,
DS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: analysis of fit to cosine wave
Graph Builder is flexible, but it focuses on visualization. See the Nonlinear platform for fitting and evaluating models. You can update the column formula used as the model and then plot it in Graph Builder.