-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathGinhom.Rd
188 lines (181 loc) · 6.74 KB
/
Ginhom.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
\name{Ginhom}
\alias{Ginhom}
\title{
Inhomogeneous Nearest Neighbour Function
}
\description{
Estimates the inhomogeneous nearest neighbour function \eqn{G} of
a non-stationary point pattern.
}
\usage{
Ginhom(X, lambda = NULL, lmin = NULL, ...,
sigma = NULL, varcov = NULL,
r = NULL, breaks = NULL, ratio = FALSE,
update = TRUE, warn.bias=TRUE, savelambda=FALSE)
}
\arguments{
\item{X}{
The observed data point pattern,
from which an estimate of the inhomogeneous \eqn{G} function
will be computed.
An object of class \code{"ppp"}
or in a format recognised by \code{\link{as.ppp}()}
}
\item{lambda}{
Optional.
Values of the estimated intensity function.
Either a vector giving the intensity values
at the points of the pattern \code{X},
a pixel image (object of class \code{"im"}) giving the
intensity values at all locations, a fitted point process model
(object of class \code{"ppm"}) or a \code{function(x,y)} which
can be evaluated to give the intensity value at any location.
}
\item{lmin}{
Optional. The minimum possible value of the intensity
over the spatial domain. A positive numerical value.
}
\item{sigma,varcov}{
Optional arguments passed to \code{\link{density.ppp}}
to control the smoothing bandwidth, when \code{lambda} is
estimated by kernel smoothing.
}
\item{\dots}{
Extra arguments passed to \code{\link{as.mask}} to control
the pixel resolution, or passed to \code{\link{density.ppp}}
to control the smoothing bandwidth.
}
\item{r}{
vector of values for the argument \eqn{r} at which
the inhomogeneous \eqn{K} function
should be evaluated. Not normally given by the user;
there is a sensible default.
}
\item{breaks}{
This argument is for internal use only.
}
\item{ratio}{
Logical.
If \code{TRUE}, the numerator and denominator of
the estimate will also be saved,
for use in analysing replicated point patterns.
}
\item{update}{
Logical. If \code{lambda} is a fitted model
(class \code{"ppm"} or \code{"kppm"})
and \code{update=TRUE} (the default),
the model will first be refitted to the data \code{X}
(using \code{\link{update.ppm}} or \code{\link{update.kppm}})
before the fitted intensity is computed.
If \code{update=FALSE}, the fitted intensity of the
model will be computed without fitting it to \code{X}.
}
\item{warn.bias}{
Logical value specifying whether to issue a warning
when the inhomogeneity correction factor takes extreme values,
which can often lead to biased results. This usually occurs
when insufficient smoothing is used to estimate the intensity.
}
\item{savelambda}{
Logical value specifying whether to save the values of
\code{lmin} and \code{lambda} as attributes of the result.
}
}
\details{
This command computes estimates of the
inhomogeneous \eqn{G}-function (van Lieshout, 2010)
of a point pattern. It is the counterpart, for inhomogeneous
spatial point patterns, of the nearest-neighbour distance
distribution function \eqn{G}
for homogeneous point patterns computed by \code{\link{Gest}}.
The argument \code{X} should be a point pattern
(object of class \code{"ppp"}).
The inhomogeneous \eqn{G} function is computed
using the border correction, equation (7) in Van Lieshout (2010).
The argument \code{lambda} should supply the
(estimated) values of the intensity function \eqn{\lambda}{lambda}
of the point process. It may be either
\describe{
\item{a numeric vector}{
containing the values
of the intensity function at the points of the pattern \code{X}.
}
\item{a pixel image}{
(object of class \code{"im"})
assumed to contain the values of the intensity function
at all locations in the window.
}
\item{a fitted point process model}{
(object of class \code{"ppm"} or \code{"kppm"})
whose fitted \emph{trend} can be used as the fitted intensity.
(If \code{update=TRUE} the model will first be refitted to the
data \code{X} before the trend is computed.)
}
\item{a function}{
which can be evaluated to give values of the intensity at
any locations.
}
\item{omitted:}{
if \code{lambda} is omitted, then it will be estimated using
a `leave-one-out' kernel smoother.
}
}
If \code{lambda} is a numeric vector, then its length should
be equal to the number of points in the pattern \code{X}.
The value \code{lambda[i]} is assumed to be the
the (estimated) value of the intensity
\eqn{\lambda(x_i)}{lambda(x[i])} for
the point \eqn{x_i}{x[i]} of the pattern \eqn{X}.
Each value must be a positive number; \code{NA}'s are not allowed.
If \code{lambda} is a pixel image, the domain of the image should
cover the entire window of the point pattern. If it does not (which
may occur near the boundary because of discretisation error),
then the missing pixel values
will be obtained by applying a Gaussian blur to \code{lambda} using
\code{\link{blur}}, then looking up the values of this blurred image
for the missing locations.
(A warning will be issued in this case.)
If \code{lambda} is a function, then it will be evaluated in the
form \code{lambda(x,y)} where \code{x} and \code{y} are vectors
of coordinates of the points of \code{X}. It should return a numeric
vector with length equal to the number of points in \code{X}.
If \code{lambda} is omitted, then it will be estimated using
a `leave-one-out' kernel smoother.
The estimate \code{lambda[i]} for the
point \code{X[i]} is computed by removing \code{X[i]} from the
point pattern, applying kernel smoothing to the remaining points using
\code{\link{density.ppp}}, and evaluating the smoothed intensity
at the point \code{X[i]}. The smoothing kernel bandwidth is controlled
by the arguments \code{sigma} and \code{varcov}, which are passed to
\code{\link{density.ppp}} along with any extra arguments.
}
\value{
An object of class \code{"fv"}, see \code{\link{fv.object}},
which can be plotted directly using \code{\link{plot.fv}}.
}
\references{
Van Lieshout, M.N.M. and Baddeley, A.J. (1996)
A nonparametric measure of spatial interaction in point patterns.
\emph{Statistica Neerlandica} \bold{50}, 344--361.
Van Lieshout, M.N.M. (2010)
A J-function for inhomogeneous point processes.
\emph{Statistica Neerlandica} \bold{65}, 183--201.
}
\seealso{
\code{\link{Finhom}},
\code{\link{Jinhom}},
\code{\link{Gest}}
}
\examples{
\dontrun{
plot(Ginhom(swedishpines, sigma=bw.diggle, adjust=2))
}
plot(Ginhom(swedishpines, sigma=10))
}
\author{
Original code by Marie-Colette van Lieshout.
C implementation and R adaptation by \adrian
and \ege.
}
\keyword{spatial}
\keyword{nonparametric}