Hi all, I am dealing with paleoceanographic data and I have a C14 time serie and one other variable. I would like to perform a spectral analysis (fft or wavelet) and plot it. Unfortunately I don't know the exact script to do this. Does anybody could send me an example to perform my spectral analysis ? I Thank you David Changez de tête et de tenue tous les jours si vous le voulez ! Volez la vedette sur Yahoo! Québec Avatars [[alternative HTML version deleted]]
On 06-Jun-07 20:55:09, David LEDU wrote:> Hi all, > > I am dealing with paleoceanographic data and I have a C14 time serie > and one other variable. I would like to perform a spectral analysis > (fft or wavelet) and plot it. Unfortunately I don't know the exact > script to do this. Does anybody could send me an example to perform my > spectral analysis ? > > I Thank you > > DavidThere are a lot of possible ramifications to your query, but for a basic spectral analysis of a series you can use the function spectrum() in the "stats" package. What is the role of the "other variable"? Best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <ted.harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 06-Jun-07 Time: 22:34:07 ------------------------------ XFMail ------------------------------
On Wed, 2007-06-06 at 13:55 -0700, David LEDU wrote:> Hi all, > > I am dealing with paleoceanographic data and I have a C14 time serie > and one other variable. I would like to perform a spectral analysis > (fft or wavelet) and plot it. Unfortunately I don't know the exact > script to do this. Does anybody could send me an example to perform my > spectral analysis ? > > I Thank you > > DavidInvariably data of this nature are irregularly sampled in time, so you should check whether the in-built spectrum() function is suitable for your core data. I'm not aware of much else available in R, but one thing I am aware of is a paper and R code by Mathias et al in the Journal of Statistical Software: http://www.jstatsoft.org/index.php?vol=11 It is issue 2 in that volume. This might be more suitable given your data. The code is a few years old now and there isn't a ready built package on CRAN so you'll have to compile it yourself. HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [t] +44 (0)20 7679 0522 ECRC [f] +44 (0)20 7679 0565 UCL Department of Geography Pearson Building [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street London, UK [w] http://www.ucl.ac.uk/~ucfagls/ WC1E 6BT [w] http://www.freshwaters.org.uk/ %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
David and Ted, since David asked about wavelets, there are some examples at the packages Wavethresh and Waveslim that could be useful. Waveslim deals with time series that are or are not a power of 2, but must be regularly spaced. Wavethresh 3 (http://www.maths.bris.ac.uk/~wavethresh/) has methods to analyze irregular time series, as suggested by Ted but their length must be a power of 2. Regards, Rogerio ---------- Cabe?alho original ----------- De: r-help-bounces at stat.math.ethz.ch Para: "David LEDU" david.ledu at yahoo.ca C?pia: r-help at stat.math.ethz.ch Data: Wed, 06 Jun 2007 22:34:21 +0100 (BST) Assunto: Re: [R] Spectral analysis> On 06-Jun-07 20:55:09, David LEDU wrote: > > Hi all, > > > > I am dealing with paleoceanographic data and I have a C14 time serie > > and one other variable. I would like to perform a spectral analysis > > (fft or wavelet) and plot it. Unfortunately I don't know the exact > > script to do this. Does anybody could send me an example to perform my > > spectral analysis ? > > > > I Thank you > > > > David > > There are a lot of possible ramifications to your query, > but for a basic spectral analysis of a series you can use > the function spectrum() in the "stats" package. > > What is the role of the "other variable"? > > Best wishes, > Ted. > > -------------------------------------------------------------------- > E-Mail: (Ted Harding) <ted.harding at nessie.mcc.ac.uk> > Fax-to-email: +44 (0)870 094 0861 > Date: 06-Jun-07 Time: 22:34:07 > ------------------------------ XFMail ------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >