Skip to content
Prev 155932 / 398502 Next

Help with 'spectrum'

Kevin- this is a simple rescaling of the axes so that the "area under the
curve" remains constant (and is half of the variance since you only look at
the positive frequencies).   In this case, freq(x) = 1/dx, where dx is the
time between points.   It is basically a graphic device so that you get
pretty graphics and it's akin to drawing probability histograms so that area
corresponds to probability.  I think you'd get a good idea of what is going
on by doing this:

x <- ts(cos(2*pi*1:60*1/12))    # think of monthly high temps
y <- ts(x, freq=12)
par(mfrow=c(2,1))
plot(x)
plot(y)
# see the difference?  ... which do you prefer? now do this:

par(mfrow=c(2,1))
spec.pgram(x, taper=0, log="no")    # freq axis is 0 to .5 cycles per unit
time (which is 1)
spec.pgram(y, taper=0, log="no")    # freq axis is 0 to 6 cycles per unit
time (which is 12)
#   ... which do you prefer?

and you'll see by stretching the frequency axis you have to adjust the
spectrum axis accordingly so that you maintain "variance under the curve".
rkevinburton wrote:
-----
The power of accurate observation is commonly called cynicism 
by those who have not got it.  George Bernard Shaw