[R] spatstat rmh problem
Sebastian Schutte
schuttesebastian at gmail.com
Tue Sep 16 08:17:28 CEST 2014
> You should use:
> plot(density(rmh(mod,new.coef=c(1,200))))
>
Sorry, my bad, typo in the example code.
> (2) However, even when the correct call is given you still wind up
> with identical densities!!!
>
> Hmmmmm. I think this may be a bug; I'll will check with the other
> authors of spatstat and report back.
>
Thanks!
>
> On 16/09/14 16:30, Sebastian Schutte wrote:
>> Thanks so much for your comments. Sorry for not having sent a running
>> example from the start. Here it is:
>>
>> library (spatstat)
>>
>> #Load example data
>> data(demopat)
>> #Generate a random point pattern within the polygon
>> set.seed(12345)
>> pdat <- rpoint(200,win=demopat$window)
>> #Generate a distmap, which will serve as covariate information
>> im.cdat <- as.im(distmap(pdat))
>> #Now the random seed is fixed and a new set of random points is
>> generated for the example
>> set.seed(11111)
>> pdat <- rpoint(200,win=demopat$window)
>> #Fitting a model to the data
>> mod <- ppm (pdat ~ im.cdat)
>> #Now a point pattern is simulated via rmh from the fitted model an
>> visualized as a density surface
>> set.seed(22222)
>> plot(density(rmh(mod)))
>> #And here is the problem: When I repeat the exercise with different
>> coefs, the very same patter come out. "new.coef" has no effect.
>> set.seed(22222)
>> plot(density(rmh(mod),new.coef=c(1,200)))
>>
>> What am I missing?
>
More information about the R-help
mailing list