比 cumquant 更有效的计算累积分位数的方法是什么?

发布于 2025-01-19 12:35:35 字数 247 浏览 4 评论 0原文

我正在尝试计算大型数据集(超过 1000 万)中某一列的累积分位数(10 个百分点、25 个百分点等)。

我尝试使用 cumstats 包中的函数 cumquant,但需要很长时间(超过一个小时;玩具测试表明,需要 40 秒以上才能获得具有 100,000 个值的向量的结果(例如cumquant(1:100000,p=0.1))。

是否有更有效的方法使用 data.table (或其他)来计算它?

I'm trying to calculate the cumulative quantile (10 percentile, 25 percentile, etc.) over a column in a large dataset (over 10 million).

I tried to use the function cumquant from the cumstats package but it takes long (longer than an hour; a toy test shows that it takes more than 40 seconds to obtain results for a vector with 100,000 values (e.g. cumquant(1:100000,p=0.1)).

Is there a more efficient way to calculate it using data.table (or others)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文