Marginal effects analysis is fundamental to interpreting statistical models, yet existing implementations face computational constraints that limit analysis at scale. We introduce two Julia packages that address this gap. Margins.jl provides a clean two-function API organizing analysis around a 2-by-2 framework: evaluation context (population vs profile) by analytical target (effects vs predictions). The package supports interaction analysis through second differences, elasticity measures, categorical mixtures for representative profiles, and robust standard errors. FormulaCompiler.jl provides the computational foundation, transforming statistical formulas into zero-allocation, type-specialized evaluators that enable O(p) per-row computation independent of dataset size. Together, these packages achieve 622x average speedup and 460x memory reduction compared to R's marginaleffects package, with successful computation of average marginal effects and delta-method standard errors on 500,000 observations where R fails due to memory exhaustion, providing the first comprehensive and efficient marginal effects implementation for Julia's statistical ecosystem.


翻译:边际效应分析是解释统计模型的基础,但现有实现面临计算限制,难以进行大规模分析。我们推出了两个Julia软件包以填补这一空白。Margins.jl提供了一个简洁的双函数API,围绕2×2框架组织分析:评估情境(总体与剖面)乘以分析目标(效应与预测)。该软件包通过二阶差分、弹性度量、代表性剖面的分类混合以及稳健标准误支持交互分析。FormulaCompiler.jl提供了计算基础,将统计公式转换为零分配、类型特化的评估器,实现与数据集规模无关的O(p)逐行计算。这两个软件包共同实现了相较于R的marginaleffects包平均622倍的速度提升和460倍的内存缩减,并成功在50万观测值上计算了平均边际效应和δ-方法标准误(而R因内存耗尽而失败),为Julia统计生态系统提供了首个全面且高效的边际效应实现方案。

0
下载
关闭预览

相关内容

【2023新书】Julia数据分析,474页pdf
专知会员服务
59+阅读 · 2023年2月5日
《Julia数据科学》及代码,166页pdf
专知会员服务
49+阅读 · 2021年11月4日
关于GANs在医学图像领域应用的总结
计算机视觉life
13+阅读 · 2019年7月25日
【边缘计算】边缘计算面临的问题
产业智能官
17+阅读 · 2019年5月31日
概率图模型体系:HMM、MEMM、CRF
机器学习研究会
30+阅读 · 2018年2月10日
边缘计算:万物互联时代新型计算模型
计算机研究与发展
15+阅读 · 2017年5月19日
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关VIP内容
【2023新书】Julia数据分析,474页pdf
专知会员服务
59+阅读 · 2023年2月5日
《Julia数据科学》及代码,166页pdf
专知会员服务
49+阅读 · 2021年11月4日
相关基金
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员