I am having some troubles trying to produce a leverage plot for a point pattern model in spatstat
. This is weird though, because yesterday it worked perfectly fine with the exact same model, and now it just doesn't.
I have a model with 3 covariates and a Geyer interaction, that runs correctly without producing any warning messages. However, when I try to produce the leverage plot I get first this warning:
Large quadrature scheme split into blocks to avoid memory size
limits;6404 dummy points split into 8 blocks, the first 7 blocks
containing 801 dummy points and the last block containing 797 dummy
points
And then this error:
Error in ppmInfluenceEngine(fit, what = what, ..., iScore = iScore, iHessian = iHessian, :
number of items to replace is not a multiple of replacement length
I assume the problem has something to do with the fact that R tries to split the quadrature scheme, because before, when it didn't crash and I was able to produce a leverage plot with the exact same model, it didn't have to split it (or at least it din't let me know about it!)
library(spatstat)
#generate a pattern
pattern <- rpoispp(1454)
summary(pattern)
#generate a covariate
cov1 <- rnoise(rgen = rnorm, dimyx=32, mean=2, sd=1, w = pattern$window)
cov2 <- rnoise(rgen = rnorm, dimyx=32, mean=1, sd=7, w = pattern$window)
cov3 <- rnoise(rgen = rnorm, dimyx=32, mean=5, sd=10, w = pattern$window)
#fit the model
fit <- ppm(pattern ~ cov1 + cov2 + cov3, Geyer(r = 0.01, s = 0.02))
leverage(fit) #this produces the warning and then the error
I am running R version 3.3.1 and spatstat version 1.46-1