plot.Results_IMIFA {IMIFA} | R Documentation |
Plotting output and parameters of inferential interest for IMIFA and related models
Description
Plotting output and parameters of inferential interest for IMIFA and related models
Usage
## S3 method for class 'Results_IMIFA'
plot(x,
plot.meth = c("all", "correlation", "density", "errors", "GQ",
"means", "parallel.coords", "trace", "zlabels"),
param = c("means", "scores", "loadings", "uniquenesses",
"pis", "alpha", "discount"),
g = NULL,
mat = TRUE,
zlabels = NULL,
heat.map = TRUE,
show.last = FALSE,
palette = NULL,
ind = NULL,
fac = NULL,
by.fac = FALSE,
type = c("h", "n", "p", "l"),
intervals = TRUE,
common = TRUE,
partial = FALSE,
titles = TRUE,
transparency = 0.75,
...)
Arguments
x |
An object of class |
plot.meth |
The type of plot to be produced for the Special types of plots which don't require a
The argument |
param |
The parameter of interest for any of the following |
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 |
mat |
Logical indicating whether a |
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 |
heat.map |
A logical which controls plotting posterior mean loadings or posterior mean scores as a heatmap, or else as something akin to |
show.last |
A logical indicator which defaults to |
palette |
An optional colour palette to be supplied if overwriting the default palette set inside the function by |
ind |
Either a single number indicating which variable to plot when |
fac |
Optional argument that provides an alternative way to specify |
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 |
type |
The manner in which the plot is to be drawn, as per the |
intervals |
Logical indicating whether credible intervals around the posterior mean(s) are to be plotted when |
common |
Logical indicating whether plots with Note that this affects the |
partial |
Logical indicating whether plots of type |
titles |
Logical indicating whether default plot titles are to be used ( |
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 |
... |
Other arguments typically passed to |
Value
The desired plot with appropriate output and summary statistics printed to the console screen.
Note
Supplying the argument zlabels
does not have the same effect of reordering the sampled parameters as it does if supplied directly to get_IMIFA_results
.
When mat
is TRUE
and by.fac
is FALSE
(both defaults), the convention for dealing with overplotting for trace
and density
plots when param
is either scores
or loadings
is to plot the last factor first, such that the first factor appears 'on top'.
Author(s)
Keefe Murphy - <keefe.murphy@mu.ie>
References
Murphy, K., Viroli, C., and Gormley, I. C. (2020) Infinite mixtures of infinite factor analysers, Bayesian Analysis, 15(3): 937-963. <doi:10.1214/19-BA1179>.
See Also
mcmc_IMIFA
, get_IMIFA_results
, mat2cols
, plot_cols
Examples
# See the vignette associated with the package for more graphical examples:
# vignette("IMIFA", package = "IMIFA")
# data(olive)
# simIMIFA <- mcmc_IMIFA(olive, method="IMIFA")
# resIMIFA <- get_IMIFA_results(simIMIFA, z.avgsim=TRUE)
# Examine the posterior distribution(s) of the number(s) of clusters (G) &/or latent factors (Q)
# For the IM(I)FA and OM(I)FA methods, this also plots the trace of the active/non-empty clusters
# plot(resIMIFA, plot.meth="GQ")
# plot(resIMIFA, plot.meth="GQ", g=2)
# Plot clustering uncertainty (and, if available, the similarity matrix)
# plot(resIMIFA, plot.meth="zlabels", zlabels=olive$area)
# Visualise the posterior predictive reconstruction error
# plot(resIMIFA, plot.meth="errors", g=1)
# Compare histograms of the data vs. replicate draw from the posterior for the 1st variable
# plot(resIMIFA, plot.meth="errors", g=2, ind=1)
# Visualise empirical vs. estimated covariance error metrics
# plot(resIMIFA, plot.meth="errors", g=3)
# Look at the trace, density, posterior mean, and correlation of various parameters of interest
# plot(resIMIFA, plot.meth="all", param="means", g=1)
# plot(resIMIFA, plot.meth="all", param="means", g=1, ind=2)
# plot(resIMIFA, plot.meth="trace", param="scores")
# plot(resIMIFA, plot.meth="trace", param="scores", by.fac=TRUE)
# plot(resIMIFA, plot.meth="mean", param="loadings", g=1)
# plot(resIMIFA, plot.meth="mean", param="loadings", g=1, heat.map=FALSE)
# plot(resIMIFA, plot.meth="parallel.coords", param="uniquenesses")
# plot(resIMIFA, plot.meth="density", param="pis", intervals=FALSE, partial=TRUE)
# plot(resIMIFA, plot.meth="all", param="alpha")
# plot(resIMIFA, plot.meth="all", param="discount")