Bob O'Hara
unread,Sep 4, 2012, 9:33:13 AM9/4/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to r-inla-disc...@googlegroups.com
I'm trying to fit a LGCP to some species distribution data, and want to include covariates. Now, I have some environmental data (from WorldClim, if you're interested), at the points where the species was observed, and also over a fine scale grid. I want to use this data as covariates. All the examples I've found don't use any covariates.
So, my model is going to be something like this:
formula = y ~ Altitude + f(idx, model=spde)
where y is the fake data, so 0 for the integration matrix and 1 for the observation matrix. Obviously for the 1's I can use the altitude at those points. But what about at the integration points? I think I can take an average(*) of the covariate in the polygon around each integration point (see Fig. 2 in "Going off the Grid"), but how can I extract these polygons? Once I have each polygon, I assume can use point.in.polygon() in the sp package to extract the right points.
(*) I suspect this is so, but I need to stare at the maths for a bit. For the moment I'll assume it is, because I assume whatever is correct will involve extracting these points anyway.
Can anyone tell me what to do?