Hi
r-help-bounces at r-project.org napsal dne 09.09.2008 18:44:34:
For the command 'spectrum' I read:
The spectrum here is defined with scaling 1/frequency(x), following
This makes the spectral density a density over the range
+frequency(x)/2], whereas a more common scaling is 2? and range (-0.5,
(e.g., Bloomfield) or 1 and range (-?, ?].
Forgive my ignorance but I am having a hard time interpreting this. Does
mean that in the spectrum output every element of the $spec array is
1/frequency(x)? I am having a hard time determing what is meant by
'frequency'.Say I define a time series for a year with samples for every
I input a 'frequency' of 365 (which in my mind is the period). On the
of 'spectrum' would this mean that every element of the $spec array is
by 1/365? There is a corresponding frequency array on the output from
'spectrum'. If the frequency is 365 and an element in the frequency
output from 'spectrum' is .1 am I to assume that the period is 36.5 and
corresponding sin wave would be sin(2 * pi * 36.5/365)?
Well, although I am not an expert in this matter I try to explain my
humble understanding of spectrum results.
sss<-spectrum(sunspots)
sss$freq[which.max(sss$spec)]
[1] 0.09166667
1/sss$freq[which.max(sss$spec)]
[1] 10.90909
you can see that maximum of spec value is for this time series at freq
0.09 and 1/0.09 is almost eleven. Knowing that sunspots have periodicity
11 years I assume that for each series I can get an information about its
periodicity by 1/freq. E.g. if your series is days 1/freq means period in
days.
Regards
Petr
Thank you in advance for helping me clear up some confusion.
Kevin