Description Usage Arguments Details Value Author(s) References See Also Examples
Detect features in a 2D or 3D spatial point pattern using nearest neighbour clutter removal.
1 2 3 4 5 6 7 8 9 10 11 12 
X 
A twodimensional spatial point pattern (object of class

k 
Degree of neighbour: 
... 
Arguments passed to 
edge.correct 
Logical flag specifying whether periodic edge correction should be performed (only implemented in 2 dimensions). 
wrap 
Numeric value specifying the relative size of the margin
in which data will be replicated for the
periodic edge correction (if 
convergence 
Relative tolerance threshold for testing convergence of EM algorithm. 
maxit 
Maximum number of iterations for EM algorithm. 
plothist 
Logical flag specifying whether to plot a diagnostic histogram of the nearest neighbour distances and the fitted distribution. 
verbose 
Logical flag specifying whether to print progress reports. 
Byers and Raftery (1998) developed a technique for recognising features in a spatial point pattern in the presence of random clutter.
For each point in the pattern, the distance to the kth nearest neighbour is computed. Then the EM algorithm is used to fit a mixture distribution to the kth nearest neighbour distances. The mixture components represent the feature and the clutter. The mixture model can be used to classify each point as belong to one or other component.
The function nnclean
is generic, with methods for
twodimensional point patterns (class "ppp"
)
and threedimensional point patterns (class "pp3"
)
currently implemented.
The result is a point pattern (2D or 3D) with two additional columns of marks:
A factor, with levels "noise"
and "feature"
,
indicating the maximum likelihood classification of each point.
Numeric vector giving the estimated probabilities that each point belongs to a feature.
The object also has extra information stored in attributes:
"theta"
contains the fitted parameters
of the mixture model, "info"
contains
information about the fitting procedure, and "hist"
contains
the histogram structure returned from hist.default
if plothist = TRUE
.
An object of the same kind as X
,
obtained by attaching marks to the points of X
.
The object also has attributes, as described under Details.
Original by Simon Byers and Adrian Raftery. Adapted for spatstat by \adrian.
Byers, S. and Raftery, A.E. (1998) Nearestneighbour clutter removal for estimating features in spatial point processes. Journal of the American Statistical Association 93, 577–584.
1 2 3 4 5 6 7 8  data(shapley)
X < nnclean(shapley, k=17, plothist=TRUE)
plot(X, which.marks=1, chars=c(".", "+"), cols=1:2)
plot(X, which.marks=2, cols=function(x)hsv(0.2+0.8*(1x),1,1))
Y < split(X, un=TRUE)
plot(Y, chars="+", cex=0.5)
marks(X) < marks(X)$prob
plot(cut(X, breaks=3), chars=c(".", "+", "+"), cols=1:3)

Loading required package: nlme
Loading required package: rpart
spatstat 1.510 (nickname: 'Poetic Licence')
For an introduction to spatstat, type 'beginner'
Note: spatstat version 1.510 is out of date by more than 3 months; we recommend upgrading to the latest version.
Iteration 1 logLik = 278639.351265579 p = 0.7999
Iteration 2 logLik = 291807.054056264 p = 0.6958
Iteration 3 logLik = 301159.278584005 p = 0.599
Iteration 4 logLik = 306823.492143299 p = 0.5188
Iteration 5 logLik = 308987.009704574 p = 0.4717
Iteration 6 logLik = 309393.565081773 p = 0.4474
Iteration 7 logLik = 309320.073419838 p = 0.4342
Estimated parameters:
p [cluster] = 0.43422
lambda [cluster] = 177.77
lambda [noise] = 12.549
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.