[R-sig-Geo] Spatstat: (coef(summary()) inquiry/problem.

Adrian Baddeley adrian.baddeley at uwa.edu.au
Wed May 21 05:05:09 CEST 2014


On 21/05/14 03:28, Silvia Cordero-Sancho wrote:

> I am running a hybrid model (following Baddeleyet al 2013). I am using the
> ppm function, the tendency is being represented by a set of environmental
> variables  ("im"- format) and the incidence is being represented by a
> hybrid model (StraussHard and AreaInter). It seems that everything is
> working properly, I have been able to use the following tools with the
> model (simulate(), diagnose.ppm()) but I have not been successful to use
> the tool  (coef(summary()).
>
> The problem is that it runs for hours,  which made me concern that there is
> something abnormal, (so I killed the process after a couple of hours). With
>   previous models (no hybrid ones) I was able to use this tool and display
> the coefficients without problem. I will like to know if this is "normal"
> or it is a sign that it is something abnormal with my model.

This is `normal' behaviour in the current version of spatstat.

Because the Hybrid models are relatively new, the package is not yet 
optimised to support them. 

By typing coef(summary(...)) you are asking for the fitted coefficients
and their **standard errors**.

summary.ppm calls vcov.ppm which calculates variance estimates
for the fitted parameters of the model. The variance calculation is 
very time-consuming (because it involves evaluating the
second order conditional intensity for every pair of data points).

For some models, such as pairwise interactions and the area-interaction model,
we have special C code which accelerates this calculation by 3 orders of magnitude. 

For a general Hybrid model, we haven't implemented this yet, so the package has to
fall back on the generic algorithm. Hence it takes about 1000 times as long to do the
variance calculation for Hybrid(A,B) as it does to do it for A and separately for B.

The area-interaction model is computationally expensive, and the computation time
increases dramatically with the disc radius r. Temporary solutions could be to use
smaller interaction radius, or to replace AreaInter with a less computationally-demanding
model.

In the next version of spatstat (1.37-1) we will include a partial implementation
of the fast C code for hybrids, which will work for your example.

Prof Adrian Baddeley FAA
University of Western Australia



More information about the R-sig-Geo mailing list