# Re: [R] Fourier Analysis and Curve Fitting in R

From: Rolf Turner <r.turner_at_auckland.ac.nz>
Date: Sat, 26 Jan 2008 12:40:06 +1300

On 26/01/2008, at 10:54 AM, Carson Farmer wrote:

> Dear List,
>
> I am attempting to perform a harmonic analysis on a time series of
> snow
> depth, in which the annual curve is essentially asymmetric (i.e. snow
> accumulates slowly over time, and the subsequent melt occurs
> relatively
> rapidly). I am trying to fit a curve to the data, however, the actual
> frequency is unknown.

```	Obviously there is something I am not understanding here.
I would have thought that the ``actual frequency'' would
be 1/(1 year) (period = 1 year) --- modulo the fact that
the length of the year is constantly changing a tiny bit.
(But I would've thought that this would have no practical
impact in respect of any observed series.)

What is your sampling interval, BTW? Day?  Week?  Month?

```

> I have been trying to follow the methods in Peter
> Bloomfields text "Fourier Analysis of Time Series", but am having
> trouble implementing this in R.

```	Note that even though the ``actual frequency'' is (???) 1/(1 year),
the representation of the mean function in terms of sinusoids
will involve in theory infinitely many terms/frequencies since
the mean function is clearly (!) not a sinusoid.

```

> Does anyone have any suggestions, or perhaps directions on how this
> might be done properly? Am I using the right methods for fitting an
> asymmetric curve?

```	I would have to know more about what you are *really* trying
to do, and what the data are like, before I could make any
useful suggestions.  Many modelling issues could come into
play, and many modelling strategies are potentially applicable.

cheers,

Rolf Turner

######################################################################
```
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

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 Fri 25 Jan 2008 - 23:44:17 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 26 Jan 2008 - 02:30:08 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.