[R] Cycle Regression Analysis in R?

Charles C. Berry cberry at tajo.ucsd.edu
Fri Jan 11 01:44:15 CET 2008


On Thu, 10 Jan 2008, Carson Farmer wrote:

> Hello R community,
>
> Does anyone know of a package that will perform cycle regression
> analysis? I have searched the R-help archives etc. but have come up with
> nothing so far.
> If I am unable to find an existing R package to do so, is there anyone
> familiar with fitting sine functions to data.  My problem is this:
> I have a long time-series of daily SWE estimates (SWE = snow water
> equivalence, or the amount of water stored in a snowpack) which follows
> a sinusoidal pattern, and I need to estimate the parameters of the sine
> function that best fits this data. While there may be many contributing
> sine functions and/or linear trends, I am only interested in a single
> sine function that most closely fits the data (trends can be removed
> separately if need be).  Perhaps some sort of non-linear least squares
> method would be best?


Or maybe stl? ( Seasonal Decomposition of Time Series by Loess )

Try

 	example( stl )

and see the reference in

 	?stl

HTH,

Chuck

p.s. Surely, SWE is NOT sinusoidal. At least not in my local mountains.


>
> Any help, or suggestions to get me on the right track are greatly
> appreciated.
>
> Carson
>
> ______________________________________________
> 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.
>

Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901




More information about the R-help mailing list