- x
An object of class "Results_IMIFA"
generated by get_IMIFA_results
.
- plot.meth
The type of plot to be produced for the param
of interest, where correlation
refers to ACF/PACF plots, means
refers to posterior means, density
, trace
and parallel.coords
are self-explanatory. "all"
in this case, the default, refers to "trace"
, "density"
, "means"
, and "correlation"
. "parallel.coords"
is only available when param
is one of "means"
, "loadings"
, or "uniquenesses"
- note that this method applies a small amount of horizontal jitter to avoid overplotting.
Special types of plots which don't require a param
are:
"GQ"
for plotting the posterior summaries of the numbers of clusters/factors, if available.
"zlabels"
for plotting clustering uncertainties - in four different ways (incl. the posterior confusion matrix) - if clustering has taken place, with or without the clustering labels being supplied via the zlabels
argument. If available, the average similarity matrix, reordered according to the MAP labels, is shown as a 5-th plot.
"errors"
for conducting posterior predictive checking of the appropriateness of the fitted model by visualising the posterior predictive reconstruction error (PPRE) &/or histograms comparing the data to replicate draws from the posterior distribution &/or error metrics quantifying the difference between the estimated and empirical covariance matrices. The type of plot(s) produced depends on how the error.metrics
argument was supplied to get_IMIFA_results
and what parameters were stored.
The argument g
can be used to cycle through the available plots in each case. ind
can also be used to govern which variable is shown for the 2-nd plot.
param
The parameter of interest for any of the following plot.meth
options: all
, trace
, density
, means
, correlation
. The param
must have been stored when mcmc_IMIFA
was initially ran. Includes pis
for methods where clustering takes place, and allows posterior inference on alpha
(for the "IMFA"
, "IMIFA"
, "OMFA"
, and "OMIFA"
methods) and discount
(for the "IMFA"
and "IMIFA"
methods). Otherwise "means"
, "scores"
, "loadings"
, and "uniquenesses"
can be plotted.
g
Optional argument that allows specification of exactly which cluster the plot of interest is to be produced for. If not supplied, the user will be prompted to cycle through plots for all clusters. Also functions as an index for which plot to return when plot.meth
is GQ
, zlabels
, or errors
in much the same way.
mat
Logical indicating whether a matplot
is produced (defaults to TRUE
). If given as FALSE
, ind
is invoked.
zlabels
The true labels can be supplied if they are known. If this is not supplied, the function uses the labels that were supplied, if any, to get_IMIFA_results
. Only relevant when plot.meth = "zlabels"
. When explicitly supplied, misclassified observations are highlighted in the first type of uncertainty plot (otherwise observations whose uncertainty exceed the inverse of the number of clusters are highlighted). For the second type of uncertainty plot, when zlabels
are explicitly supplied, the uncertainty of misclassified observations is marked by vertical lines on the profile plot.
heat.map
A logical which controls plotting posterior mean loadings or posterior mean scores as a heatmap, or else as something akin to link{plot(..., type="h")}
. Only relevant if param = "loadings"
(in which case the default is TRUE
) or param = "scores"
(in which case the default is FALSE
). Heatmaps are produced with the aid of mat2cols
and plot_cols
.
show.last
A logical indicator which defaults to FALSE
, but when TRUE
replaces any instance of the posterior mean with the last valid sample. Only relevant when param
is one of "means"
"scores"
, "loadings"
, "uniquenesses"
, or "pis"
and plot.meth
is one of "all"
or "means"
. Also relevant for "means"
, "loadings"
and "uniquenesses"
when plot.meth
is "parallel.coords"
. When TRUE
, this has the effect of forcing intervals
to be FALSE
.
palette
An optional colour palette to be supplied if overwriting the default palette set inside the function by viridis
is desired. It makes little sense to a supply a palette
when plot.meth="all"
and param
is one of "scores"
or "loadings"
.
ind
Either a single number indicating which variable to plot when param
is one of means
or uniquenesses
(or plot.meth="errors"
), or which cluster to plot if param
is pis
. If scores
are plotted, a vector of length two giving which observation and factor to plot; if loadings
are plotted, a vector of length two giving which variable and factor to plot. Will be recycled to length 2 if necessary. Also governs which two factors are displayed on posterior mean plots of the "scores"
when heat.map
is FALSE
; otherwise only relevant when mat
is FALSE
.
fac
Optional argument that provides an alternative way to specify ind[2]
when mat
is FALSE
and param
is one of scores
or loadings
.
by.fac
Optionally allows (mat)plotting of scores and loadings by factor - i.e. observation(s) (scores) or variable(s) (loadings) for a given factor, respectively, controlled by ind
or fac
) when set to TRUE
. Otherwise all factor(s) are plotted for a given observation or variable when set to FALSE
(the default), again controlled by ind
or fac
. Only relevant when param
is one of scores
or loadings
.
type
The manner in which the plot is to be drawn, as per the type
argument to plot
.
intervals
Logical indicating whether credible intervals around the posterior mean(s) are to be plotted when is.element(plot.meth, c("all", "means"))
. Defaults to TRUE
, but can only be TRUE
when show.last
is FALSE
.
common
Logical indicating whether plots with plot.meth="means"
(or the corresponding plots for plot.meth="all"
) when param
is one of "means"
, "scores"
, "loadings"
, or "uniquenesses"
are calibrated to a common scale based on the range of the param
parameters across all clusters (defaults to TRUE
, and only relevant when there are clusters). Otherwise, the only the range corresponding to the image being plotted is used to determine the scale.
Note that this affects the "loadings"
and "scores"
plots regardless of the value of heat.map
. An exception is the "scores"
plots when plot.meth="means"
and heat.map
is FALSE
, in which case common
defaults to FALSE
.
partial
Logical indicating whether plots of type "correlation"
use the PACF. The default, FALSE
, ensures the ACF is used. Only relevant when plot.meth = "all"
, otherwise both plots are produced when plot.meth = "correlation"
.
titles
Logical indicating whether default plot titles are to be used (TRUE
), or suppressed (FALSE
).
transparency
A factor in [0, 1] modifying the opacity for overplotted lines. Defaults to 0.75, unless semi-transparency is not supported. Only relevant when palette
is not supplied, otherwise the supplied palette
must already be adjusted for transparency.
...
Other arguments typically passed to plot
or the breaks
argument to mat2cols
and heat_legend
when heatmaps are plotted.