Moment matching with iwmm package
还没有人认领这个 Issue。
评估
调研方向
首先审查 loo::loo_moment_match 以及链接的 iwmm 包中的通用实现,包括对 matrix、stanfit 和 CmdStanFit 的支持。比较 issue 中的三个互操作性选项,并确定应采用哪种设计;完成意味着项目已经确定了扩展受支持输入的方法。
由索引模型根据 Issue 内容生成。
描述
Currently loo_moment_match only works on stanfit objects (due to the reliance on the log_prob methods from rstan), but not CmdStanFit or just a matrix of draws (see e.g. #209). I was thinking about the best way to expand support of loo_moment_match to other objects, and am opening this issue mostly for discussion at this stage.
@topipa has created a generic implementation of moment matching (iwmm) which works on a matrix or stanfit object. Recently we have also added CmdStanFit support to this package (using the new model methods in cmdstanr which are currently not yet in a release).
iwmm is not (yet) on CRAN, so now might be a good time to discuss the best way to interoperate with loo.
After some discussion with @avehtari, I currently see three options (there may be others I haven't thought of):
- update functions in loo, no change to dependencies
Code from iwmm is copied into loo and adapted for use inloo::loo_moment_match(made specific for leave-one-out importance posteriors). iwmm would remain an independent package for generic importance sampling. - add iwmm dependency in loo
iwmm is submitted to CRAN andloo::loo_moment_matchis rewritten to useiwmm::moment_match. loo would then import and depend on iwmm. - move iwmm functions into loo
All iwmm functions are moved into loo, and kept generic (i.e. not specific for leave-one-out posteriors). Keeping the functions generic has some precedence as loo is the home ofloo::psiswhich is used in cases other than leave-one-out CV (e.g. in priorsense and adjustr).
@jgabry @avehtari @topipa @paul-buerkner , do you have any thoughts on this?
- 主要语言
- R
- 星标
- 157
- 派生
- 38
- 平均合并
- 4 天 16 小时
- 30 天内合并 PR
- 2
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stan-dev/loo 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
Clean up issues未关闭
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
难度 2/5 半天 新手友好度 78/100
ThinkR-open/datadiff#59 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
duckdb/duckdb-r#2773 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
tidymodels/parsnip#1444 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100