[R] spectrum

Andreas Pauling pauling at giub.unibe.ch
Thu Jan 22 18:00:44 CET 2004


Dear R users

I have two questions about estimating the spectral power of a
time series:

1) I came across a funny thing with the following code:

data(co2)
par(mfrow=c(2,1))
co2.sp1<-spectrum(co2,detrend=T,demean=T,span=3)
co2.sp2<-spectrum(co2[1:468],detrend=T,demean=T,span=3)

The first plot displays the frequencies ranging from 0 to 6
whearas the second plot displays the same curve but with
frequencies between 0 and .5 although it is based on the same
data (length(co2)=468). Why does the selection (co2[1:468])
determine the vector of frequencies and plot it obviously
incorrectly?

Generally, is it possible to choose the vector of frequencies at
which the spectral density is estimated and plotted?

2) How can the significance of the peaks be tested?


Thanks for any help!!


Andreas


------------------------------------------------------
This mail was sent through IMP at http://mail.unibe.ch




More information about the R-help mailing list