kfun {ads}  R Documentation 
Computes estimates of Ripley's Kfunction and associated neighbourhood functions from an univariate spatial point pattern in a simple (rectangular or circular) or complex sampling window. Computes optionally local confidence limits of the functions under the null hypothesis of Complete Spatial Randomness (see Details).
kfun(p, upto, by, nsim=0, prec=0.01, alpha=0.01)
p 
a 
upto 
maximum radius of the sample circles (see Details). 
by 
interval length between successive sample circles radii (see Details). 
nsim 
number of Monte Carlo simulations to estimate local confidence limits of the null hypothesis of complete spatial randomness (CSR) (see Details).
By default 
prec 
if 
alpha 
if 
Function kfun
computes Ripley's K(r) function of secondorder neighbourhood analysis and the associated functions g(r), n(r) and L(r).
For a homogeneous isotropic point process of intensity λ, Ripley (1977) showed that
the secondorder property could be characterized by a function K(r), so that the expected
number of neighbours within a distance r of an arbitrary point of the pattern is:
N(r) = λ*K(r).
K(r) is a intensity standardization of N(r), which has an expectation of π*r^2 under the null hypothesis of CSR: K(r) = N(r)/λ.
n(r) is an area standardization of N(r), which has an expectation of λ under the null hypothesis of CSR: n(r) = N(r)/(π*r^2), where π*r^2 is the area of the disc of radius r.
L(r) is a linearized version of K(r) (Besag 1977), which has an expectation of 0 under the null hypothesis of CSR: L(r) = √(K(r)/π)r. L(r) becomes positive when the pattern tends to clustering and negative when it tends to regularity.
g(r) is the derivative of K(r) or pair density function (Stoyan et al. 1987), so that the expected
number of neighbours at a distance r of an arbitrary point of the pattern (i.e. within an annuli between two successive circles with radii r and rby) is:
O(r) = λ*g(r).
The program introduces an edge effect correction term according to the method proposed by Ripley (1977)
and extended to circular and complex sampling windows by Goreaud & P?Pelissier (1999).
Theoretical values under the null hypothesis of CSR as well as local Monte Carlo confidence limits and pvalues of departure from CSR (Besag & Diggle 1977) are estimated at each distance r.
A list of class "fads"
with essentially the following components:
r 
a vector of regularly spaced out distances ( 
g 
a data frame containing values of the pair density function g(r). 
n 
a data frame containing values of the local neighbour density function n(r). 
k 
a data frame containing values of Ripley's function K(r). 
l 
a data frame containing values of the modified Ripley's function L(r). 

Each component except 
obs 
a vector of estimated values for the observed point pattern. 
theo 
a vector of theoretical values expected for a Poisson pattern. 
sup 
(optional) if 
inf 
(optional) if 
pval 
(optional) if 
Function kfun
ignores the marks of multivariate and marked point patterns, which are analysed as univariate patterns.
There are printing and plotting methods for "fads"
objects.
Besag J.E. 1977. Discussion on Dr Ripley's paper. Journal of the Royal Statistical Society B, 39:193195.
Besag J.E. & Diggle P.J. 1977. Simple Monte Carlo tests spatial patterns. Applied Statistics, 26:327333.
Goreaud F. & P?Pelissier R. 1999. On explicit formulas of edge effect correction for Ripley's Kfunction. Journal of Vegetation Science, 10:433438.
Ripley B.D. 1977. Modelling spatial patterns. Journal of the Royal Statistical Society B, 39:172192.
Stoyan D., Kendall W.S. & Mecke J. 1987. Stochastic geometry and its applications. Wiley, NewYork.
plot.fads
,
spp
,
kval
,
k12fun
,
kijfun
,
ki.fun
,
kmfun
.
data(BPoirier) BP < BPoirier ## Not run: spatial point pattern in a rectangle sampling window of size [0,110] x [0,90] swr < spp(BP$trees, win=BP$rect) kswr < kfun(swr,25,1,500) plot(kswr) ## Not run: spatial point pattern in a circle with radius 50 centred on (55,45) swc < spp(BP$trees, win=c(55,45,45)) kswc < kfun(swc, 25, 1, 500) plot(kswc) ## Not run: spatial point pattern in a complex sampling window swrt < spp(BP$trees, win=BP$rect, tri=BP$tri1) kswrt < kfun(swrt, 25, 1, 500) plot(kswrt)