r - Betareg 导致内存分配问题

标签 r summary beta

我正在尝试使用 betareg 包在 R 中运行 beta 回归模型。但是,我出乎意料地遇到了内存大小问题。让我解释一下为什么这让我感到惊讶。

我使用的是 Windows 7、64 位、R-64,并且有 32 GB 的 RAM。

我正在运行的 betareg 命令是::

br1 <- betareg(dfp ~ ago + evl + spe + low + poly(fpt, 4, raw = T), data = tt[tt$zero_one_ind == 1, ], model = T, y = F, x = F)

betareg模型的对象大小为:

print(object.size(br1), units = "Mb") 46 Mb

这是我收到的错误消息:

Error: cannot allocate vector of size 344.1 Gb
In addition: Warning messages:
1: In diag(x %*% xwx1 %*% t(x)) :
Reached total allocation of 32693Mb: see help(memory.size)
2: In diag(x %*% xwx1 %*% t(x)) :
 Reached total allocation of 32693Mb: see help(memory.size)
3: In diag(x %*% xwx1 %*% t(x)) :
 Reached total allocation of 32693Mb: see help(memory.size)
4: In diag(x %*% xwx1 %*% t(x)) :
Reached total allocation of 32693Mb: see help(memory.size)

betareg 模型在 R 中成功运行并估计了系数,据我所知所有槽都已填充,但看起来 R 无法构建方差协方差矩阵。有什么地方出了问题吗?

最佳答案

我遇到了同样的问题,解决方法很简单。

来自手册:

Note that the default residuals "sweighted2" might be burdensome to compute in large samples and hence might need modification in such applications.

例如,您可以使用摘要中的其他选项之一:

type = c(“pearson”, “deviance”, “response”, “weighted”, “sweighted”, “sweighted2”)

关于r - Betareg 导致内存分配问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26369099/

相关文章:

r - 如何在迷宫中找到最短路线?

r - 关于R中的 "gsheet"包

r - 在 R 中,选择向量时 [[X]] 和 [, X] 有什么区别

r - 如何将带有观察计数的标签添加到 stat_summary ggplot?

SVN更新总结

iphone - Beta 测试 iphone 和 ipad 应用程序

c# - 更新到 beta8 后无法发布 asp.net 5 应用程序 - 依赖项......无法解决

arrays - 标准化数组

r - dplyr - 查找 y 列的所有最大值和相应的 x 值

cocoa - 部署 Beta 软件更新和 Sparkle