Plots a spectral density function,
line spectrum, or spectral distribution from a model fitted with lspec
# S3 method for lspec
plot(x, what = "b", n, add = FALSE, xlim, ylim, xlab = "", ylab = "",
type, ...)
lspec
object, typically the result of lspec
.
what should be plotted: b (spectral density and line spectrum superimposed), d (spectral density function), l (line spectrum) or p (spectral distribution function).
the number of equally spaced points at which to plot the fit; default is max(100,fit\$sample)
.
indicate that the plot should be added to an existing plot.
X-axis plotting limits: default is \(c(0,\pi)\), except when what = "p", when the default is \(c(-\pi,\pi)\).
Y-axis plotting limits.
axis labels.
plotting type; default is "l"
when what = "d"
and what = "p"
, "h"
when what = "l"
, and
a combination of "h"
and "l"
when what ="b"
all regular plotting options are passed on.
Charles Kooperberg clk@fredhutch.org.
Charles Kooperberg, Charles J. Stone, and Young K. Truong (1995). Logspline Estimation of a Possibly Mixed Spectral Distribution. Journal of Time Series Analysis, 16, 359-388.
Charles J. Stone, Mark Hansen, Charles Kooperberg, and Young K. Truong. The use of polynomial splines and their tensor products in extended linear modeling (with discussion) (1997). Annals of Statistics, 25, 1371--1470.
lspec
, summary.lspec
, clspec
, dlspec
,
plspec
, rlspec
.
data(co2)
co2.detrend <- lm(co2~c(1:length(co2)))$residuals
fit <- lspec(co2.detrend)
plot(fit)
Run the code above in your browser using DataLab