View source: R/exdqlmFit_methods.R
| plot.exdqlmFit | R Documentation |
exdqlmFit ObjectsPlot fitted dynamic quantiles, fitted component contributions, or individual
state elements from a dynamic fit. The default type = "quantile",
plots the MAP estimates and 95% credible intervals (CrIs) of the dynamic
quantile. type = "component" plots the MAP estimates and CrIs for a
specified component. type = "state" plots the MAP estimates and CrIs
of a single element of the dynamic state vector.
## S3 method for class 'exdqlmFit'
plot(
x,
type = c("quantile", "component", "state"),
index = NULL,
add = FALSE,
col = "purple",
cr.percent = 0.95,
xlim = NULL,
ylim = NULL,
xlab = "time",
ylab = NULL,
lwd = 1.5,
lwd.interval = 0.75,
lty.interval = 2,
...
)
x |
A fitted dynamic |
type |
Character string specifying the plot type. Use
|
index |
Required for |
add |
Optional logical value indicating whether the estimate will be
added to existing plot. Default is |
col |
Optional character vector of length 1 giving color of the
estimate to be plotted. Default is |
cr.percent |
Optional numeric in |
xlim, ylim |
Optional limits passed to the base plotting call. |
xlab, ylab |
Optional axis labels passed to the base plotting call. |
lwd, lwd.interval |
Line widths for the estimate and credible interval bounds, respectively. |
lty.interval |
Line type for the credible interval bounds. |
... |
Additional arguments. |
Invisibly returns a list of the following:
map.quant - MAP estimate of the dynamic estimate.
lb.quant - Lower bound of the 95% CrIs of the dynamic estimate.
ub.quant - Upper bound of the 95% CrIs of the dynamic estimate.
x - Time/index values used for plotting.
data("scIVTmag", package = "exdqlm")
old = options(exdqlm.max_iter = 15L)
y = scIVTmag[1:80]
trend.comp = polytrendMod(2, rep(mean(y), 2), 10*diag(2))
seas.comp = seasMod(365, c(1, 2), C0 = 10*diag(4))
model = trend.comp + seas.comp
M0 = exdqlmLDVB(y, p0 = 0.85, model, df = c(0.98, 1), dim.df = c(2, 4),
gam.init = -3.5, sig.init = 15,
n.samp = 20, tol = 0.2, verbose = FALSE)
# plot quantile
plot(M0)
# plot first harmonic component
plot(M0, type="component", index = c(3, 4), col = "blue")
options(old)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.