[R] help! - spectral analysis - spec.pgram

Uwe Ligges ligges at statistik.tu-dortmund.de
Fri May 14 13:27:57 CEST 2010



On 14.05.2010 06:03, vikrant wrote:
>
> series<-c(0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10
> ,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10)
>
>
> Here ain this example after period 4 the pattern repeats. So we can say that
> the above series have a period of  4.
>
> Now my question is by using the  function
> spec.pgram(series, log="no")
>
> we will get a graph of power vs frequency. Correct me if I am wrong.
>
>
>
> Now from this graph I want to determine the period of seasonality. How
> should I determine it??
>
>


You find that the first highest peak is at freq 0.1666667 hence 
1/0.1666667 = 6 is your period (not 4).
But as I said before, you need to read a textbook about Fourier analysis 
/ the spectrum...


Uwe Ligges



More information about the R-help mailing list