Learn R Programming

bspcov (version 1.0.3)

plot.quantile.bspcov: Plot method for quantile.bspcov objects

Description

Create visualization plots for posterior quantiles of covariance matrices. Produces heatmap visualizations showing uncertainty across different quantile levels.

Usage

# S3 method for quantile.bspcov
plot(
  x,
  type = "heatmap",
  titles = NULL,
  ncol = 3,
  color_limits = NULL,
  color_low = "black",
  color_high = "white",
  base_size = 14,
  legend_position = "bottom",
  x_label = "Variable",
  y_label = "Variable",
  width = NULL,
  height = 6,
  ...
)

Value

A ggplot object (single quantile) or patchwork object (multiple quantiles) showing heatmap visualizations.

Arguments

x

an object of class quantile.bspcov from quantile() function.

type

character string specifying plot type. Options are "heatmap" (default), "uncertainty", or "comparison".

titles

character vector of titles for each quantile plot. If NULL, auto-generated titles are used.

ncol

number of columns in the plot layout. Default is 3.

color_limits

optional vector of length 2 specifying color scale limits. If NULL, computed from data.

color_low

color for low values in heatmap. Default is "black".

color_high

color for high values in heatmap. Default is "white".

base_size

base font size for plot theme. Default is 14.

legend_position

position of legend. Default is "bottom".

x_label

label for x-axis. Default is "Variable".

y_label

label for y-axis. Default is "Variable".

width

plot width when saving. Default is calculated based on number of quantiles.

height

plot height when saving. Default is 6.

...

additional arguments passed to plotting functions.

Author

Kyeongwon Lee

See Also

quantile, plot.bspcov, plot.postmean.bspcov

Examples

Run this code
# \donttest{
# Example with simulated data
n <- 25
p <- 50
Sigma0 <- diag(1, p)
X <- MASS::mvrnorm(n = n, mu = rep(0, p), Sigma = Sigma0)
res <- bspcov::bandPPP(X, 2, 0.01, nsample = 100)
quant <- quantile(res)

# Plot uncertainty visualization
plot(quant)

# Plot with custom titles and labels
plot(quant, titles = c("Lower Bound", "Median", "Upper Bound"),
     x_label = "Variable", y_label = "Variable")
# }

Run the code above in your browser using DataLab