Re: [R] Fitting a sine wave using solver

From: Carl Witthoft <carl_at_witthoft.com>
Date: Sat, 22 Nov 2008 14:32:52 -0500


To follow Dieter's comment,

You can in fact fit a data to a sine in Excel using LINEST. I've done it. I don't recommend it :-) .

What I did was create columns containing sin(x) and cos(x) , roughly speaking, and fit using

LINEST([y=values],{sines, cosines},...)

Ya need the cosines or something similar to get rid of phase ambiguity.

But using either FFTs or glm() should do fine.

And stay away from Excel! :-(

Carl



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 22 Nov 2008 - 19:35:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 22 Nov 2008 - 20:30:39 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive