Produces plots for an MTD object. By default, it shows the following
sequence of plots: (i) barplot of oscillations by relevant lag,
(ii) barplot of mixture weights \(\lambda_j\) (including lam0 if > 0)
and (iii) graphs of pj, one graph for each lag in Lambda. When
type is specified, only the requested plot is drawn.
# S3 method for MTD
plot(x, type, main, ylim, col = "gray70", border = NA, pj_index = 1, ...)If type is "oscillation" or "lambdas", invisibly returns the numeric
vector that was plotted. If type = "pj", invisibly returns the selected transition
matrix. If type is missing, invisibly returns a list with components
oscillation and lambdas.
An object of class "MTD".
If type is missing, all plots are shown sequentially
(press Enter to proceed). Else, type is a character string indicating
what to plot: "oscillation", "lambdas" or "pj".
Optional main title. When type is missing, panel-specific
defaults are used and main is ignored.
Optional y-axis limits. When type is missing, panel-specific
defaults are used and ylim is ignored.
Bar fill color (passed to barplot). Defaults to "gray70".
Bar border color (passed to barplot). Defaults to NA.
Integer index of pj(x) to plot when type = "pj"
(default 1).
Further graphical parameters: passed to barplot() when
type %in% c("oscillation","lambdas") and to plot.igraph()
when type = "pj". Ignored when type is missing.
For type = "oscillation", the function calls oscillation(x)
to obtain \(\delta_j = \lambda_j \max_{b,c} d_{TV}(p_j(\cdot|b), p_j(\cdot|c))\)
for each lag in Lambda(x), and draws a bar plot named by the lags.
For type = "lambdas", it plots the mixture weights \(\lambda_j\) by lag.
If lam0 > 0, the weight for the independent component is included and
labeled "0".
For type = "pj", the function draws the directed, weighted graph of a
transition matrix pj taken from pj(x). Vertices correspond to the
states states(x). A directed edge a -> b carries weight
p_j(b | a). Edge widths and edge labels are proportional to the transition
probabilities (labels shown in the plot are rounded to two decimals).
By default, self-loops (a -> a) are not drawn. The self-loop probability
at a state a can be inferred as $$1 - \sum_{b: b \ne a} p_j(b \mid a).$$
For type = "pj", a specific matrix can be selected via pj_index
(e.g., pj_index = 2 plots pj(x)[[2]]). In automatic mode (when
type is missing), graphs for all pj matrices are shown
sequentially.
oscillation, lambdas, Lambda
if (FALSE) {
m <- MTDmodel(Lambda = c(1, 3), A = c(0, 1))
## Automatic mode (press Enter between plots)
plot(m)
## Single plot:
plot(m, type = "oscillation")
plot(m, type = "lambdas")
plot(m, type = "pj", pj_index = 2)
}
Run the code above in your browser using DataLab