autoplot.Hidalgo {intRinsic}R Documentation

Plot the output of the Hidalgo function

Description

Use this method without the .Hidalgo suffix. It produces several plots to explore the output of the Hidalgo model.

Usage

## S3 method for class 'Hidalgo'
autoplot(
  object,
  type = c("raw_chains", "point_estimates", "class_plot", "clustering"),
  class_plot_type = c("histogram", "density", "boxplot", "violin"),
  class = NULL,
  psm = NULL,
  clust = NULL,
  title = NULL,
  ...
)

Arguments

object

object of class Hidalgo, the output of the Hidalgo() function.

type

character that indicates the requested type of plot. It can be:

"raw_chains"

plot the MCMC and the ergodic means NOT corrected for label switching;

"point_estimates"

plot the posterior mean and median of the id for each observation, after the chains are processed for label switching;

"class_plot"

plot the estimated id distributions stratified by the groups specified in the class vector;

"clustering"

plot the posterior coclustering matrix. Rows and columns can be stratified by an exogenous class and/or a clustering solution.

class_plot_type

if type is chosen to be "class_plot", one can plot the stratified id estimates with a "density" plot or a "histogram", or using "boxplots" or "violin" plots.

class

factor variable used to stratify observations according to their the id estimates.

psm

posterior similarity matrix containing the posterior probability of coclustering.

clust

vector containing the cluster membership labels.

title

character string used as title of the plot.

...

other arguments passed to specific methods.

Value

a ggplot2 object produced by the function according to the type chosen. More precisely, if

method = "raw_chains"

The functions produces the traceplots of the parameters d_k, for k=1...K. The ergodic means for all the chains are superimposed. The K chains that are plotted are not post-processed. Ergo, they are subjected to label switching;

method = "point_estimates"

The function returns two scatterplots displaying the posterior mean and median id for each observation, after that the MCMC has been postprocessed to handle label switching;

method = "class_plot"

The function returns a plot that can be used to visually assess the relationship between the posterior id estimates and an external, categorical variable. The type of plot varies according to the specification of class_plot_type, and it can be either a set of boxplots or violin plots or a collection of overlapping densities or histograms;

method = "clustering"

The function displays the posterior similarity matrix, to allow the study of the clustering structure present in the data estimated via the mixture model. Rows and columns can be stratified by an exogenous class and/or a clustering structure.

See Also

Hidalgo

Other autoplot methods: autoplot.gride_bayes(), autoplot.twonn_bayes(), autoplot.twonn_linfit(), autoplot.twonn_mle()


[Package intRinsic version 1.0.2 Index]