[R-sig-Geo] Using pixel image as spatstat's intensity surface
Rolf Turner
r.turner at auckland.ac.nz
Tue Jul 23 23:57:14 CEST 2013
On 24/07/13 07:56, Allar Haav wrote:
> Dear Rolf,
>
> Thank you for insightful answer. Following your explanation I found
> out that the key problem was that I didn't specify the simulation in
> Linhom envelope. For some reason I thought that lambda would be
> overriding the envelope creating point process. So, your example 4 was
> really helpful for that matter.
>
> However in order to produce a proper-looking graph with an envelope, I
> had to use reciplambda instead of the regular one. I figured this out
> after seeing that while envelope was calculated and displayed
> correctly, the observed Linhom(r) line did not appear (envelope's
> "obs" values are either 0's or NaN's). Using reciplambda did the trick
> though, but the values on the y-axis are 1e+07 times smaller than they
> should. Creating random patterns using rpoispp() does not indicate at
> all that the intensity surface should be used reciprocally: the number
> of points and their spatial distribution make sense. Also if using
> randomly created points there is no need for reciplambda, although it
> works both ways showing slightly different results. Another worrying
> issue, but I'll try to look into it.
This does not make a hell of a lot of sense to me. Can you make your
data ("sites" and "model")
available to me to experiment with and see what is going on?
Basically if you think that "model" represents the underlying intensity
for "sites" then
X <- rpoispp(model)
should bear at least a *vague* resemblance to "sites". If you think
that "model" represents
the reciprocal of the underlying intensity for "sites" then
recipMod <- eval.im(1/model)
Y <- rpoispp(recipMod)
should yield a "Y" which bears at least a vague resemblance to "sites".
If neither of these
apply then it would appear that "model" has nothing to do with the
intensity underlying sites,
and you shouldn't be using it. Or perhaps some other transformation of
"model" is
required. Perhaps you need to use exp(model)? This would apply if
"model" arises from
the *linear* predictor of a loglinear model for the intensity.
cheers,
Rolf
More information about the R-sig-Geo
mailing list