Plot Spectra

DESCRIPTION:

Plots the results of a spectrum estimation.

USAGE:

spec.plot(spec.list, add=FALSE, type="l", main=NULL, 
          xlab="frequency", ylab="spectrum", conf.band=!add) 

REQUIRED ARGUMENTS:

spec.list
list like that returned by the time series spectrum estimation functions: spectrum, spec.pgram or spec.ar, including at least the components freq and spec.

OPTIONAL ARGUMENTS:

add
if TRUE, the spectrum plot will be superimposed on an existing spectrum plot. This is useful to compare different spectral estimates for the same series.
type
desired type of plot. Besides the default of "l" (lines), this could be "h" (high density), "p" (points), or "b" (both lines and points).
main
user supplied title.
xlab
label for x-axis, default is "frequency".
ylab
label for y-axis, default is "spectrum".
conf.band
if TRUE, the 95% confidence interval and the bandwidth of the estimate will be plotted in the upper right corner, and printed as subtitle.

SIDE EFFECTS:

plots the spectrum (or spectra for multivariate series) along with a cross in the upper right corner whose vertical component indicate the 95% confidence interval for the spectrum (based on a chi-squared approximation) and whose horizontal element indicates the bandwidth of the estimate. This does not plot the coherency or phase of multivariate series.

SEE ALSO:

, , .

EXAMPLES:

sun.sp1 <- spec.pgram(sunspots, span=1, plot=T) 
sun.sp2 <- spectrum(sunspots, spans=c(19,19,19), plot=F) 
spec.plot(sun.sp2, add=T) 
spec.plot(sun.sp2)