| compPlot | R Documentation |
The function plots the dynamic MAP estimates and 95% credible intervals (CrIs) of a specified component of an exDQLM. Alternatively, if just.theta=TRUE the MAP estimates and 95% credible intervals (CrIs) of a single element of the dynamic state vector are plotted.
compPlot(
m1,
index,
add = FALSE,
col = "purple",
just.theta = FALSE,
cr.percent = 0.95,
plot = TRUE,
xlim = NULL,
ylim = NULL,
xlab = "time",
ylab = NULL,
lwd = 1.5,
lwd.interval = 0.75,
lty.interval = 2
)
m1 |
An object of class " |
index |
Vector of consecutive integers in |
add |
Logical value indicating whether the dynamic component will be added to existing plot. Default is |
col |
Character vector of length 1 giving color of the dynamic component to be plotted. Default is |
just.theta |
Logical; if |
cr.percent |
Numeric in |
plot |
Logical value indicating whether to draw the plot. If |
xlim, ylim |
Optional limits passed to the base plotting call when |
xlab, ylab |
Optional axis labels passed to the base plotting call when |
lwd, lwd.interval |
Line widths for the dynamic component and credible interval bounds, respectively. |
lty.interval |
Line type for the credible interval bounds. |
A list of the following is returned:
map.comp - MAP estimate of the dynamic component (or element of the state vector).
lb.comp - Lower bound of the 95% CrIs of the dynamic component (or element of the state vector).
ub.comp - Upper bound of the 95% CrIs of the dynamic component (or element of the state vector).
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(0, 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 first harmonic component
compPlot(M0, index = c(3, 4), col = "blue")
c.summary = compPlot(M0, index = c(3, 4), plot = FALSE)
options(old)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.