

My apologies for taking so long to get back to you;
your email got put away and temporarily forgotten about.

Having finally remembered to deal with your inquiry, I'm
afraid I cannot reproduce your error with simulated data.

The script below runs without problem, and the envelope produced
appears to be sensible:

#
# Script scr.demo
#

# 0. Set a seed to make the results reproducible.
set.seed(42)

# 1. Generate artificial data with which to experiment:
W <- owin(c(0,60000),c(0,60000))
U <- runifpoint(400,W)
i <- sample(1:400,150)
A <- U[i]

# 2. Do the proposed envelope calculation procedure:
dens   <- density(U)
nn     <- npoints(A)/npoints(U)
intens <- eval.im(dens*nn)
r      <- seq(0,15000,by=250)
e      <- expression(rpoispp(intens))
res    <- envelope(A, Kinhom, lambda=intens, r=r, simulate=e,nsim=99,
                    correction="Ripley", verbose=FALSE)

# 3. No errors or warnings occur; plot the result:
plot(res)

If you have not yet been able to resolve your problems, perhaps you
could provide a data set which demonstrates these problems.

	cheers,

		Rolf Turner

On 13/01/2011, at 7:35 AM, Karthik Ram wrote:

> I am using package spatstat to analyze two spatial point pattern  
> datasets.
>
> Object U is a ppp object of the distribution of grassland sites at a
> particular elevation/site
> Object A is a ppp object of a subset of those locations undergoing  
> a process
> of interest to me.
>
> My goal is to detect whether points in A are clustered in space, while
> taking into account the fact that there is already some underlying  
> spatial
> structure (so this is not a homogeneous point pattern).
>
> So I smoothed out my reference (U), calculated a predicted  
> intensity, and
> computed the inhomogeneous K function.
>
> Relevant portions of my code look like this:
>
> dens=density(U)
> nn=npoints(A)/npoints(U)
> intens= eval.im(dens*nn)
> r=seq(0,15000,by=250) # because my points are spaced apart in 250m  
> intervals
> and I am not interested in clustering at distances greater than 15k
> e=expression(rpoispp(intens))
> res=(envelope(A, Kinhom, lambda=dens, r=r, simulate=e,nsim=99,
> correction="Ripley", verbose=FALSE))
>
> However, in running this function, I get this warning for every single
> dataset.
>
>  In envelopeEngine(X = X, fun = fun, simul = simrecipe, nsim =  
> nsim,  :
> Window containing simulated patterns is not a subset of data window
>
> Can anyone shed some light on why I see these errors? While  
> creating my ppp
> object, I added a sufficient border (300m on all sides) and even  
> used the
> same sized window for both the underlying distribution of points  
> (U) and
> points of interest (A). I tried to add the exact same window to  
> rpoispp but
> that didn't help.



	[[alternative HTML version deleted]]

