No articles match
ラッパー関数の使い方11 days ago
ラッパー関数とは | ラッパー関数一覧 | 推定のイメージ | 頻度主義的分析 | S3メソッド | print_code() | 事後分析 | 欠損値の扱い (Missing Data Handling) | 分析例:因子分析における完全情報最尤法(FIML) | 分析例:相関分析におけるペアワイズ削除(Pairwise) | 次に読む記事
BayesRTMB Analysis Reference18 days ago
0. How To Read This Page | Goal-Oriented Quick Navigation | 1. Analysis Workflow | 1.1 Choosing An Estimation Method | 2. Function Overview | 2.1 Model Definition | 2.2 Wrapper Functions | 2.3 Estimation Methods | 3. Common Fit-Object Methods | 3.1 estimate(), EAP(), and MAP() | 3.2 pars And component | 4. MCMC_Fit | 4.1 Main Methods | 4.2 draws() | 4.3 summary() And diagnose() | 4.4 transformed_draws() And generated_quantities() | 4.5 Bridge Sampling And Bayes Factors | 4.6 WAIC | 5. MAP_Fit | 5.1 Main Methods | 5.2 num_estimate And The Best Run | 5.3 Using Optimization Results As Initial Or Fixed Values | 5.4 profile() | 5.5 WAIC For MAP Fits | 6. VB_Fit | 6.1 Main Methods | 6.2 num_estimate And Best Estimate | 6.3 Checking Convergence With plot_elbo() | 6.4 WAIC For VB Fits | 7. Classic_Fit | 7.1 Main Methods | 7.2 ANOVA | 7.3 AIC, BIC, And logLik | 7.4 robust_se() | 7.5 lsmeans() | 8. Model Comparison And Evaluation Criteria | 8.1 Bayes Factor | 8.2 WAIC | 8.3 AIC/BIC | 8.4 ELBO | 9. Fixing Parameters With fixed | 9.1 Checking Parameter Names | 9.2 Internal Handling Of fixed | 9.3 Limitations Of fixed | 9.4 Using Optimization Results As Fixed Values | 9.5 Using MCMC Results As Fixed Values | 9.6 fixed And Bayes Factors | 10. rtmb_code() Blocks | 10.1 What Belongs In setup | 10.2 What Belongs In transform | 10.3 What Belongs In generate | 10.4 Choosing Between transform And generate | 11. Parameter Declarations And Types | 11.1 Dimensions | 11.2 Constraints | 11.3 random = TRUE | 12. Distribution Overview | 12.1 Continuous Distributions | 12.2 Discrete Distributions | 12.3 Multivariate And Matrix Distributions | 12.4 Mixtures And Special Distributions | 13. Math And Stabilization Functions | 14. AD Taping And Performance | 14.1 Use setup | 14.2 Prefer Vectorization | 14.3 Avoid apply-Style Functions In AD Code | 14.4 Notes On if And ifelse | 14.5 rtmb_vector() And rtmb_array() | 14.6 Taping Time And AD Evaluation Speed | 14.7 Patterns To Avoid Inside AD Tapes | 15. Common Recipes | 15.1 Get Only Estimates From MCMC | 15.2 Use MAP Initial Values For MCMC | 15.3 Extract Only Generated Quantities | 15.4 Extract Draws Including Random Effects | 15.5 Check VB Convergence | 15.6 Compare Models With Classic Estimation | 15.7 Compare Coefficient Inclusion With A Bayes Factor | 15.8 Build A Fixed Model Explicitly | 15.9 Upgrade An Old Fit Object | 15.10 Run MCMC In Parallel | 16. Caveats
Writing Model Codes18 days ago
1. Overview of the Structure and Role of rtmb_code | 1-1. parameters block | 1-2. model block | 1-3. setup block | 1-4. transform block | 1-5. generate block | 2. Available Probability Distributions | 2-1. Common Probability Density and Mass Functions | 2-2. Advanced Probability Distributions | 2-3. Probability Distributions for Special Types | 2-4. User-Defined Distributions | 3. About Parameter Types (Dim) | 4. About Mathematical Functions | 5. AD-Compatible Working Containers | 6. Upgrading Saved Fit Objects | Conclusion
モデルの書き方18 days ago
最小モデル | rtmb_code の構造 | setup | parameters | transform | model | generate | 自作分布を使う | 回帰モデル | 中心化した回帰モデル | 事前分布を書く | 制約つきパラメータ | 階層モデル | 順序モデル | 混合分布モデル | よくある注意点 | data.frame と matrix | model ブロックを複雑にしすぎない | AD型に対する if 文 | 初期値 | random = TRUE | AD対応の作業用コンテナ | 保存済み fit object の更新 | 次に読む記事
BayesRTMB Quick Start28 days ago
Purpose of This Page | 0. Installation and Environment Check | Windows Users | 1. Write a Minimal Model | 2. Create a Model Object | 3. Run MAP Estimation | 4. Inspect the Posterior with MCMC | Parallel MCMC | 5. Visualize MCMC Results | 6. Multiple Regression with a Wrapper Function | 7. Plot an Interaction | 8. Run a Frequentist t Test | 9. Compute a Bayes Factor with a JZS Prior | Next Steps
BayesRTMB の内部構造28 days ago
1. 全体の流れ | 2. rtmb_code の各ブロック | data | setup | parameters | transform | model | generate | 3. パラメータ表現 | 4. ヤコビアン補正 | 5. RTMB の自動微分オブジェクト | 6. 推定メソッドごとの違い | sample | optimize | variational | classic | 7. optimize と classic の推定結果の違い | 8. Laplace 近似と random | 9. 標準誤差と区間推定 | 10. AD 型のコードを書くときの注意点 | パラメータに依存する if 文 | apply 系の関数 | setup と transform を使い分ける | 11. Stan、TMB、RTMB との関係 | 12. まとめ
BayesRTMB の概要28 days ago
BayesRTMB とは | 記事へのリンク | BayesRTMB でできること | 2つの入口 | ラッパー関数から始める | 自分でモデルを書く | 推定方法の使い分け | MCMC | MAP 推定 | 変分推論 | 頻度主義的分析 | ランダム効果と Laplace 近似 | モデル比較(bridge sampling / WAIC) | bridge sampling による周辺尤度と Bayes factor | WAIC によるモデル比較 | 次のステップ
BayesRTMB 分析リファレンス28 days ago
0. このページの読み方 | 目的別クイックナビ | 1. 分析ワークフロー | 1.1 使い分けの目安 | 2. 関数一覧 | 2.1 モデル定義 | 2.2 ラッパー関数 | 2.3 推定メソッド | 3. fit object共通メソッド | 3.1 estimate(), EAP(), MAP() | 3.2 parsとcomponent | 4. MCMC_Fit | 4.1 主要メソッド | 4.2 draws() | 4.3 summary()とdiagnose() | 4.4 transformed_draws()とgenerated_quantities() | 4.5 bridge samplingとBayes factor | 4.6 WAIC | 5. MAP_Fit | 5.1 主要メソッド | 5.2 num_estimateとbest run | 5.3 optimize結果を初期値や固定値に使う | 5.4 profile() | 5.5 MAP_FitのWAIC | 6. VB_Fit | 6.1 主要メソッド | 6.2 num_estimateとbest estimate | 6.3 plot_elbo()による収束確認 | 6.4 VBのWAIC | 7. Classic_Fit | 7.1 主要メソッド | 7.2 ANOVA | 7.3 AIC, BIC, logLik | 7.4 robust_se() | 7.5 lsmeans() | 8. モデル比較と評価指標 | 8.1 Bayes factor | 8.2 WAIC | 8.3 AIC/BIC | 8.4 ELBO | 9. fixedによるパラメータ固定 | 9.1 固定するパラメータ名の確認 | 9.2 fixedの内部処理 | 9.3 fixedの制限 | 9.4 optimize結果を固定値として使う | 9.5 MCMC結果を固定値として使う | 9.6 fixedとBayes factor | 10. rtmb_codeのブロック | 10.1 setupに置くべき処理 | 10.2 transformに置くべき処理 | 10.3 generateに置くべき処理 | 10.4 transformとgenerateの使い分け | 11. パラメータ宣言と型 | 11.1 次元 | 11.2 制約 | 11.3 random = TRUE | 12. 分布一覧 | 12.1 連続分布 | 12.2 離散分布 | 12.3 多変量・行列分布 | 12.4 混合分布・特殊分布 | 13. 数学・安定化関数 | 14. ADテープ化とパフォーマンス | 14.1 setupを活用する | 14.2 ベクトル化を優先する | 14.3 apply系関数を避ける | 14.4 ifとifelseの注意 | 14.5 rtmb_vector()とrtmb_array() | 14.6 テープ化時間とAD評価速度 | 14.7 ADテープ内で避けたい書き方 | 15. 典型的な用途別レシピ | 15.1 MCMCの結果から推定値だけ欲しい | 15.2 初期値をMAPから作ってMCMCを回したい | 15.3 生成量だけを取り出したい | 15.4 random effectsを含めてdrawを取り出したい | 15.5 VBの収束を見たい | 15.6 classicで頻度主義的にモデル比較したい | 15.7 Bayes factorで係数の有無を比較したい | 15.8 fixed modelを明示的に作りたい | 15.9 古いfit objectを新しいクラスに更新したい | 15.10 並列でMCMCを回したい | 16. 注意点
BayesRTMB クイックスタート28 days ago
このページの目的 | 0. インストールと環境確認 | Windows ユーザー向け | 1. 最小モデルを書く | 2. モデルオブジェクトを作る | 3. MAP 推定を行う | 4. MCMC で事後分布を見る | MCMC を並列化する場合 | 5. MCMC の結果を可視化する | 6. ラッパー関数で重回帰を行う | 7. 交互作用を図で確認する | 8. t 検定を頻度主義的に行う | 9. JZS prior で Bayes factor を計算する | 次に読むページ
Hierarchical Models and GLMMs with rtmb_glmer()28 days ago
Purpose | 1. A Minimal Random-Intercept Model | 2. Choosing an Inference Method | MCMC | MAP with Laplace Approximation | Variational Inference | Classical Estimation | 3. Formula Syntax and Visualization | Random Intercepts | Random Slopes | Multiple Grouping Factors | Conditional Effects | 4. Families | 5. Data Handling | Wide Data Can Be Converted Internally | Converting Variables to Factors | Centering Within Cluster | 6. Priors | prior_flat() | prior_normal() | prior_weak() | Regularized Priors | JZS Prior | 7. Residual Correlation | 8. ANOVA-Style Classical Workflows | 9. Inspecting Generated Code | 10. Model Comparison | 11. Related Articles
Introduction to BayesRTMB28 days ago
What is BayesRTMB? | Links to Articles | What BayesRTMB Can Do | Two Entry Points | Starting from Wrapper Functions | Writing Your Own Model | Choosing an Inference Method | MCMC | MAP Estimation | Variational Inference | Frequentist Analysis | Random Effects and Laplace Approximation | Model Comparison (Bridge Sampling / WAIC) | Marginal Likelihood and Bayes Factor by Bridge Sampling | Model Comparison by WAIC | Next Steps
RTMB Internals and Inference Algorithms28 days ago
1. Overall Flow | 2. Blocks in rtmb_code() | data | setup | parameters | transform | model | generate | 3. Parameter Representation | 4. Jacobian Correction | 5. RTMB Automatic Differentiation Objects | 6. Inference Methods | sample | optimize | variational | classic | 7. optimize() vs classic() | 8. Laplace Approximation and random | 9. Standard Errors and Intervals | 10. Writing AD-Friendly Code | Avoid parameter-dependent if statements | Be careful with apply-style functions | Use blocks for their intended purposes | 11. Relationship to Stan, TMB, and RTMB | 12. Summary
rtmb_glmer() で階層モデル・GLMM・分散分析を書く28 days ago
1. rtmb_glmer() とは | 2. 最小例: ランダム切片モデル | 3. formula の書き方と可視化 | ワイド型データと factors | conditional_effects | 4. family の選び方 | 5. 推定法の使い分け | MCMC | MAP | VB | classic | 6. prior の設計 | prior_flat | prior_normal | prior_weak | prior_rhs と prior_ssp | prior_jzs | 7. 順序カテゴリモデル | 8. 異分散と残差相関 | 9. 分散分析・lsmeans・古典的 mixed model として使う | 10. print_code() で内部モデルを見る | 11. 実践上の注意点
Wrapper Functions28 days ago
1. rtmb_ttest (Bayesian t-test) | Checking the Generated Code | Calculating the Bayes Factor | 2. rtmb_lm (Linear Regression Analysis) | Recommended Settings for Weakly Informative Priors | 3. rtmb_glm (Generalized Linear Models) | Available Distributions (family) | 4. rtmb_glmer (Generalized Linear Mixed Models) | Regularization | 5. Post-Estimation Analysis (Interaction & Visualization) | Visualization with conditional_effects() | Simple Effects Analysis with simple_effects() | 6. rtmb_corr (Correlation Matrix Estimation) | 2-Variable Correlation and Bayes Factor | Correlation Matrix Estimation | 7. rtmb_fa (Exploratory Factor Analysis) | Factor Rotation | Factor Scores | Regularized Factor Analysis | 8. rtmb_irt (Item Response Theory) | Analysis Example (Graded Response Model) | Visualizing Item Response Curves | Item and Test Information | 9. Missing Data Handling | Example: FIML in Factor Analysis (rtmb_fa) | Example: Pairwise Deletion in Correlation (rtmb_corr) | Summary