I'm currently working on Species Distribution Models and particularly with the framework developed by Ian Renner under the ppmlasso package in R. I have some questions about this framework which have been design in order to be used by practitioner without need of specialist guidance (cf. Renner et al. 2015 + Supplementary material).
If we take the data used by Renner et al. 2015:
library(spatstat)
library(ppmlasso)
load("Eucalyptus sparsifolia Atlas 2012.RData") #Contains X and Y
load("Quad1000.RData")
sp.xy=data.frame(X,Y)
ppm.form = ~ poly(FC, MNT, MXT, Rain, degree = 2, raw = TRUE)+ poly(sqrt(D.Main), sqrt(D.Urb), degree = 2, raw = TRUE)
scales = c(0.5, 1, 2, 4, 8, 16)
findres(scales, formula = ppm.form, sp.xy = sp.xy, env.grid = quad)
Fitting a regularisation path of point process models
quad.1k = sample.quad(quad, 1)
ppm.fit = ppmlasso(ft.int, sp.xy = sp.xy, env.grid = quad.1k,sp.scale = 1, criterion = "nlgcv")
Question 1:
how to obtain the map of predicted intensity? Because the equivalency function in spatstat "predict" doesn't work with ppmlasso objects, and the predict.ppmlasso function doesn't return "im" object but "large matrix"
Diagnostic of the model
In its main text (figure 3c and d) Renner drawn the "Lurking variable plot for x (and then y) coordinate Pearson residuals" with Monte Carlo simulation envelopes for an area-interaction model (Gibbs model).
Question 2:
How can we make these diagnostic plots from Gibbs models (as Ian Renner did) and with the Monte Carlo simulation envelopes?
diagnose.ppmlasso(ppm.fit, which = "smooth", type = "Pearson", labcex = 1)
# OK
diagnose.ppmlasso(ppm.fit, which = "x", type = "Pearson", compute.sd = TRUE) #doesn't work cause it's designed for ppm and not for Gibbs model
diagnose.ppmlasso(ppm.fit, which = "y", type = "Pearson", compute.sd = TRUE)
#doesn't work cause it's designed for ppm and not for Gibbs model
Question 3:
Is there a mean to acceed to the response curves, linking the intensity with each of the environmental variables implemented in the model?
Thank you very much for helping