[R] doubt on periodogram

From: Pradeep Gunda <pradeep.gunda_at_gmail.com>
Date: Tue 21 Feb 2006 - 04:15:55 EST


hi all,

I am using the periodogram function provided by the "GeneTS" library in R. The periodogram function takes a time-series as input and returns a spec(a vector of values) and their frequencies. My requirement is, I have to loop through the values in this spec and then remove some of these, depending on whether they exceed some cutoff. I could not find any function to loop through the elements of spec in periodogram. Could you inform how I can do this.

Example:


> myts <- ts(c(1,2,3,40,3,2,5,40,2,3,1,40), frequency=1);
> myper <- periodogram(myts);
> myper

$spec
             [,1]

[1,] 1.900321e+00
[2,] 8.333333e-02
[3,] 1.064833e+03
[4,] 5.833333e-01
[5,] 2.766346e+00
[6,] 1.045333e+03

$freq
[1] 0.08333333 0.16666667 0.25000000 0.33333333 0.41666667 0.50000000


my cutoff is 4.00 and I wasnt to discard all the values in the above spec vector which are less than 4. Could you help me how could I do that. I did not find any attributes or functions in periodogram through which I can do this.

Thanks and Regards,
Pradeep Kumar Gunda



R-help@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 Received on Tue Feb 21 04:21:24 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:38 EST