Learn R Programming

bspcov (version 1.0.3)

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

Description

Create heatmap visualization for posterior mean estimate of sparse covariance matrix. Provides flexible visualization options with customizable aesthetics and labeling.

Usage

# S3 method for postmean.bspcov
plot(
  x,
  title = NULL,
  color_limits = NULL,
  color_low = "black",
  color_high = "white",
  base_size = 14,
  legend_position = "bottom",
  x_label = "Variable",
  y_label = "Variable",
  show_values = FALSE,
  ...
)

Value

A ggplot object showing heatmap visualization of the posterior mean covariance matrix.

Arguments

x

an object of class postmean.bspcov from estimate() function.

title

character string for plot title. If NULL, auto-generated title is used.

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".

show_values

logical indicating whether to display values on tiles. Default is FALSE.

...

additional arguments passed to plotting functions.

Author

Seongil Jo, Kyeongwon Lee

See Also

estimate, plot.bspcov, plot.quantile.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::thresPPP(X, eps=0.01, thres=list(value=0.5,fun='hard'), nsample=100)
est <- bspcov::estimate(res)

# Basic plot
plot(est)

# Plot with custom color scheme
plot(est, color_low = "blue", color_high = "red")
# }

Run the code above in your browser using DataLab