rstanarm - 运行贝叶斯模型时出错

问题描述

编辑 - 我已经设法解决了这个问题。请参阅下面的评论

我使用 rstanarm 使用我设置的先验在 R 中运行贝叶斯回归,使用以下代码

priors <- rstanarm::normal(location = c(-1,0.5,2),scale = c(1,2,0.5))

bmd <- stan_glm(s01_1 ~ pc + a03 + l01,data=bes19,prior = priors,iter=1000,seed=6942)

这会输出以下错误,我不知道如何纠正:

  Exception: mismatch in dimension declared and found in context; processing stage=data initialization; variable name=prior_scale; position=0; dims declared=(19); dims found=(3)  (in '/data/hyperparameters.stan' at line 2; included from 'model_continuous' at line 56)

Failed to create the sampler; sampling not done
Error in check_stanfit(stanfit) : 
  Invalid stanfit object produced please report bug

如果有任何解决方案,我将不胜感激。谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)