使用mcmc_areas()函数绘制多个图的问题

发布于 2025-02-13 10:35:40 字数 1036 浏览 0 评论 0原文

因此,我想使用贝舍平台创建几块后验样品图。 我的数据包含几个绘制分为特征(列“相关”包含后值):

head(cors_feat [cors_feat $ feature == 1,])

  feature correlation
1       1  -0.5002517
2       1   0.1964202
3       1  -0.8603918
4       1  -0.7111672
5       1   0.1760033
6       1   0.2788863

head(cors_feat [cors_feat $ feature == 2,]))

      feature correlation
40001       2  -0.7149123
40002       2  -0.7666210
40003       2  -0.7542937
40004       2  -0.2094619
40005       2   0.4089077
40006       2  -0.8550481

i循环通过功能,在循环中,我使用函数mcmc_areas()创建图:

lst <- list()
for (i in 1:length(unique(cors_feat$feature))){
  lst <- c(lst,mcmc_areas(cors_feat[cors_feat$feature==i,], pars = c("correlation"), prob = 0.95))
}

当我尝试尝试时从“ cowplot”库中使用plot_grid函数,我会收到以下错误:

plot_grid(plotlist = lst)
There were 50 or more warnings (use warnings() to see the first 50)

最重要的是,我看不到任何图。

我该如何解决这个问题?

So, I wanted to create several plots of my posterior sample using bayesplot.
My data contains several draws divided into features (the column "correlation" contains the posterior values):

head(cors_feat[cors_feat$feature==1,])

  feature correlation
1       1  -0.5002517
2       1   0.1964202
3       1  -0.8603918
4       1  -0.7111672
5       1   0.1760033
6       1   0.2788863

head(cors_feat[cors_feat$feature==2,])

      feature correlation
40001       2  -0.7149123
40002       2  -0.7666210
40003       2  -0.7542937
40004       2  -0.2094619
40005       2   0.4089077
40006       2  -0.8550481

I loop through the features, and in the loop I use the function mcmc_areas() to create the plots:

lst <- list()
for (i in 1:length(unique(cors_feat$feature))){
  lst <- c(lst,mcmc_areas(cors_feat[cors_feat$feature==i,], pars = c("correlation"), prob = 0.95))
}

When I try to use the plot_grid function from from the "cowplot" library I get the following error:

plot_grid(plotlist = lst)
There were 50 or more warnings (use warnings() to see the first 50)

And most importantly, I cannot see any plot.

How can I solve this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文