| plot.FEXP {longmemo} | R Documentation |
Plot Method for FEXP and WhittleEst Model Fits
Description
(S3) methods for the generic functions plot (and
lines) applied to fractional EXP (FEXP) and
"WhittleEst" (FEXPest,
models.
plot() plots the data periodogram and the ‘FEXP'’ model
estimated spectrum, where lines() and does the latter.
Usage
## S3 method for class 'FEXP'
plot(x, log = "xy", type = "l",
col.spec = 4, lwd.spec = 2, xlab = NULL, ylab = expression(hat(f)(nu)),
main = paste(deparse(x$call)[1]), sub = NULL, ...)
## (With identical argument list:)
## S3 method for class 'WhittleEst'
plot(x, log = "xy", type = "l",
col.spec = 4, lwd.spec = 2, xlab = NULL, ylab = expression(hat(f)(nu)),
main = paste(deparse(x$call)[1]), sub = NULL, ...)
## S3 method for class 'FEXP'
lines(x, type = "l", col = 4, lwd = 2, ...)
## S3 method for class 'WhittleEst'
lines(x, type = "l", col = 4, lwd = 2, ...)
Arguments
x |
an R object of |
log |
character specifying log scale should be used, see
|
type |
plot type for the periodogram, see |
col.spec, lwd.spec, col, lwd |
graphical parameters used for drawing the
estimated spectrum, see |
xlab, ylab, main, sub |
labels for annotating the plot, see
|
... |
further arguments passed to |
Author(s)
Martin Maechler
See Also
FEXPest, WhittleEst;
plot.default and spectrum.
Examples
data(videoVBR)
fE <- FEXPest(videoVBR, order = 3, pvalmax = .5)
plot(fE)
fE3 <- FEXPest(videoVBR, order = 3, pvalmax = 1)#-> order 3
lines(fE3, col = "red3", lty=2)
f.GN <- WhittleEst(videoVBR)
f.am21 <- WhittleEst(videoVBR, model = "fARIMA",
start= list(H= .5, AR = c(.5,0), MA= .5))
lines(f.GN, col = "blue4")
lines(f.am21, col = "goldenrod")
##--- Using a tapered periodogram ---------
spvVBR <- spec.pgram(videoVBR, fast=FALSE, plot=FALSE)
fam21 <- WhittleEst(periodogr.x = head(spvVBR$spec, -1),
n = length(videoVBR), model = "fARIMA",
start= list(H= .5, AR = c(.5,0), MA= .5))
fam21
f.am21 # similar but slightly different
plot(fam21)
## Now, comparing to traditional ("log-X", not "log-log") spectral plot:
plot(fam21, log="y")
## compared to the standard R spectral plot : s
if(dev.interactive(TRUE)) getOption("device")()# a new graphics window
plot(spvVBR, log = "yes", col="gray50")
all.equal(.ffreq(fE$n) / (2*pi) -> ffr.,
head(spvVBR$freq, -1))# TRUE
lines(ffr., fam21$spec, col=4, lwd=2)
## need to adjust for different 'theta1':
lines(ffr., f.am21$spec * fam21$theta1 / f.am21$theta1,
col = adjustcolor("tomato", 0.6), lwd=2)
[Package longmemo version 1.1-3 Index]