0

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

pat-s
  • 5,992
  • 1
  • 32
  • 60
  • 1
    You may have better luck here: https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models – Carl Jul 24 '16 at 17:59

1 Answers1

1

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

Thierry
  • 18,049
  • 5
  • 48
  • 66