错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

The “neglecting the vectorization" error in Stan: erroneous coding practices for computing marginal likelihood and Bayes factors in models with vectorized truncated distributions

  • Yuki Tsukamura,
  • Kensuke Okada

摘要

The methods for statistical analysis continue to advance; however, they remain susceptible to coding errors. This paper highlights the “neglecting the vectorization" error, which is a specific type of mistake made in calculating the marginal likelihood and Bayes factors (BFs) using vectorized truncated distributions with the Stan programming language. This error arises when the normalizing constant of the truncated distribution is not properly incremented for each element of a vectorized variable. Upon examination of publicly available Stan codes, it became evident that the inadequate coding methods were employed in a significant portion of studies. As the practical methods for calculating Bayes factors—such as bridge sampling—become increasingly prevalent, careful attention must be given to ensure proper model implementation.