包含corSpatial对象时glmmPQL崩溃 [英] glmmPQL crashes on inclusion of corSpatial object

查看:65
本文介绍了包含corSpatial对象时glmmPQL崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

链接到数据(1170 obs,9个变量,.rd文件)

只需使用 readRDS(file)读取即可.

我正在尝试使用 MASS 包中的 glmmPQL 函数设置GLMM,其中包括随机效果部分并考虑了空间自相关.但是,R(版本:3.3.1)在执行时崩溃.

 库(nlme)#设置模型公式fo<-冰雹〜prec_nov_apr + t_min_nov_apr + srad_nov_apr +年龄#设置corSpatial对象correl = corSpatial(value = c(10000,0.1),form =〜ry + rx,nugget = TRUE,固定= FALSE,类型=指数")correl =初始化(correl,数据= d)#适合型号fit5<-glmmPQL(fo,随机=〜1 |日期,数据= d,correl = correl,家庭=二项式) 

到目前为止我尝试过的事情:

  • 减少观察次数
  • corSpatial 参数(范围和块)
  • 减少固定预测变量的数量
  • 在Windows,Linux(Debian)和Mac R安装上执行代码

当我在本地计算机上没有收到任何错误消息(RStudio崩溃)时,在服务器上运行脚本会返回以下错误消息:

R:malloc.c:3540:_int_malloc:断言(fwd-> size& 0x4)== 0'失败.中止

解决方案

我将使用 INLA 包对此建模,因为它允许使用与空间相关的随机效果.所需的代码太长了,无法在此处放置.因此,我将其放置在 http://rpubs.com/INBOstats/spde 上的文档中>

Link to data (1170 obs, 9 variables, .Rd file)

Simply read it in using readRDS(file).

I´m trying to setup a GLMM using the glmmPQL function from the MASS package including a random effects part and accounting for spatial autocorrelation. However, R (Version: 3.3.1) crashes upon execution.

library(nlme)

# setup model formula
fo <- hail ~ prec_nov_apr + t_min_nov_apr + srad_nov_apr + age

# setup corSpatial object
correl = corSpatial(value = c(10000, 0.1), form = ~ry + rx, nugget = TRUE,
                    fixed = FALSE, type = "exponential")
correl = Initialize(correl, data = d)

# fit model
fit5 <- glmmPQL(fo, random = ~1 | date, data = d, 
                correl = correl, family = binomial)

What I tried so far:

  • reduce number of observation
  • play with corSpatial parameters (range and nugget)
  • reduce number of fixed predictors
  • execute code on Windows, Linux (Debian) and Mac R installations

While I get no error message on my local pc (RStudio just crashes), running the script on a server returns the following error message:

R: malloc.c:3540: _int_malloc: Assertion (fwd->size & 0x4) == 0' failed. Aborted

解决方案

I'd use the INLA package to model this, as it allows to use spatially correlated random effects. The required code is a bit too long to place here. Therefore I've place it in a document on http://rpubs.com/INBOstats/spde

这篇关于包含corSpatial对象时glmmPQL崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆