[R] Identify period length of time series automatically?

Mike Marchywka marchywka at hotmail.com
Thu Apr 14 11:57:31 CEST 2011

> Date: Thu, 14 Apr 2011 11:29:23 +0200
> From: r.m.krug at gmail.com
> To: r-help at r-project.org
> Subject: [R] Identify period length of time series automatically?
> Hash: SHA1
> Hi
> I have 10.000 simulations for a sensitivity analysis. I have done a few
> sensitivity analysis for different response variables already,
> but now, as most of the simulations (if not all) show some cyclic
> behaviour, see how the independent input parameter influence the
> frequency of the cyclic changes and "how cyclic" they actually are.
> So effectively, I have 39 values, and I want to identify automatically
> the frequency / period length of the series and a kind of a measure on
> "how cyclic" the series is.

Probably google "Digital Signal Processing" or Fourier transform.
>From this, you resolve your time series into sinusoids of various components
and you can separate peaks in line spectra from background noise. 
Depending on what you consider to be "cyclic" the analysis details
will vary. If you look at things like amplitude and frequncy modulation
of one sine wave with another and various relationships between carrier and
modulation frequency, you can get some ideas of what to look for in spectra.

Alternatively, you can try to define exactly what you mean by "cyclic"
and maybe make a better transform that discriminates that from acyclic
but offhand I would suggest FFT and various tests on the spectra.

Just off hand I'm not sure that 39 points would be a lot to go on
but you can simulate some examples in R quite easily if you know
what the data looks like in various cases you think may exist.

> How can I do that automatically without individual checking? I do not
> want to do an eyeball assessment for 10.000 time series....
> Thanks,
> Rainer
> - --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa


More information about the R-help mailing list