[论文解读] Fitting Bayesian item response models in Stata and Stan
本文比較了在 Stata 中使用 bayesmh 和 StataStan 進行貝葉斯項目反應建模的表現,結果顯示,由 Stan 的哈密頓蒙地卡羅與無 U-形折返採樣器(NUTS)驅動的 StataStan 在速度、效率與可擴展性方面表現更佳,特別是在複雜的層次化 Rasch 模型中。StataStan 在每有效樣本的採樣速度上,最高可達 bayesmh 的 24.1 倍,尤其在大型模型與支援平行運算的情況下表現更為出色。
Stata users have access to two easy-to-use implementations of Bayesian inference: Stata’s native bayesmh command and StataStan, which calls the general Bayesian engine, Stan. We compare these implementations on two important models for education research: the Rasch model and the hierarchical Rasch model. StataStan fits a more general range of models than can be fit by bayesmh and uses a superior sampling algorithm, that is, Hamiltonian Monte Carlo using the no-Uturn sampler. Furthermore, StataStan can run in parallel on multiple CPU cores, regardless of the flavor of Stata. Given these advantages and given that Stan is open source and can be run directly from Stata do-files, we recommend that Stata users interested in Bayesian methods consider using StataStan.
研究动机与目标
- 評估並比較 Stata 內建的 bayesmh 與 StataStan 在擬合貝葉斯項目反應模型方面的表現。
- 評估在 Rasch 模型與層次化 Rasch 模型中,計算效率、採樣速度與有效樣本數的差異。
- 確定 StataStan 的先進採樣演算法與平行運算能力是否在實際應用中優於 bayesmh 的 Metropolis-Hastings 與 Gibbs 採樣。
- 為教育與社會科學研究中的 Stata 使用者提供採用 StataStan 進行複雜貝葉斯建模的實務建議。
提出的方法
- 使用相同的資料與先驗分佈,在 bayesmh 與 StataStan 中實作 Rasch 模型與層次化 Rasch 模型。
- 在 StataStan 中使用哈密頓蒙地卡羅與無 U-形折返採樣器(NUTS)進行高效的後驗分佈採樣。
- 在兩個軟體套件中以相同的初始值執行四條平行馬氏鏈,以確保可比性。
- 量測關鍵參數(σ², τ², µ)的總時間、僅模擬時間與每秒有效樣本數。
- 比較不同模型規模(P = 100 至 10,000 名受試者)下的結果,並評估隨機效應與平行運算的影響。
- 在 Stata 中使用 Stan 的預設均勻先驗分佈處理標準差,並透過文字型 Stan 程式碼進行自訂模型設定。
实验结果
研究问题
- RQ1bayesmh 與 StataStan 在計算效率與有效樣本數方面,擬合 Rasch 模型的表現如何比較?
- RQ2StataStan 在層次化 Rasch 模型的採樣效率上是否優於 bayesmh,特別是在模型規模增加時?
- RQ3與串行執行及 bayesmh 在未使用 Stata/MP 時的限制相比,StataStan 的平行運算能力在多大程度上提升了性能?
- RQ4結果對先驗分佈的設定有多敏感?StataStan 的預設先驗處理是否提升了模型的穩健性?
- RQ5在 bayesmh 中使用隨機效應選項對採樣效率與有效樣本數有何影響?
主要发现
- 在層次化 Rasch 模型中,StataStan 在總時間上快了 2.4 至 14.1 倍,在僅模擬時間上快了 3.5 至 24.1 倍(針對 σ²)。
- 針對 τ²,StataStan 在總時間上快了 0.6 至 2.8 倍,在僅模擬時間上快了 0.8 至 6.9 倍。
- 在大多數情況下,bayesmh 對 µ 超參數的採樣效率更高,但 StataStan 在僅模擬時間上最快可達 8.9 倍。
- 若未使用隨機效應選項,bayesmh 在達到相同有效樣本數時,所需時間為 200 至 500 倍,特別是在 σ² 與 τ² 上更為明顯。
- StataStan 的平行運算將總時間減少近 50%(例如,P=1000 時,從 734 秒降至 383 秒),而 bayesmh 在未使用 Stata/MP 時無法使用平行鏈。
- StataStan 的模型編譯開銷在大型模型中被性能提升所抵銷,使其整體效率更高。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。