spectrum(x, method="pgram", plot=T, ...)
If method="pgram", then the possible arguments and their defaults are: spans=1, taper=0.1, pad=0, detrend=TRUE, demean=FALSE. The most useful of these is spans which should be a vector of odd integers specifying spans of Daniell smoothers used on the periodogram. See spec.pgram for further information.
If method="ar", additional arguments can be n.freq (the number of frequencies at which the spectrum is to be estimated - the default is 1 plus half the length of the series), and frequency (the frequency of the observations of the time series - the default is the frequency of x). See spec.ar.
If method="pgram", the spectrum is estimated by taking the discrete Fourier transform of the (detrended then tapered then padded) data. The squared modulus of this transform is then smoothed by a sequence of running averages. If method="ar", the parameters of an autoregressive model fitted to x, and its prediction variance are used to compute the spectral estimate of x. See Bloomfield (1976) for a discussion of the methods.
The chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis.
spectrum(log(lynx), pad=1, spans=3) # Compute and plot Raw Periodogram. p2 <- spectrum(log(lynx), method="ar", plot=F) spec.plot(p2,add=T) # Superimpose an autoregressive spectrum