library(dplyr)
library(ggplot2)
library(forcats)
theme_set(theme_ggdist())
expand.grid(
eta = 1:6,
K = 2:6
) %>%
ggplot(aes(y = fct_rev(ordered(eta)), dist = "lkjcorr_marginal", arg1 = K, arg2 = eta)) +
stat_slab() +
facet_grid(~ paste0(K, "x", K)) +
labs(
title = paste0(
"Marginal correlation for LKJ(eta) prior on different matrix sizes:\n",
"dlkjcorr_marginal(K, eta)"
),
subtitle = "Correlation matrix size (KxK)",
y = "eta",
x = "Marginal correlation"
) +
theme(axis.title = element_text(hjust = 0))
Run the code above in your browser using DataLab