[R] doubt on periodogram

Pradeep Gunda pradeep.gunda at gmail.com
Mon Feb 20 18:15:55 CET 2006


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




More information about the R-help mailing list