Low-level functions which
calculate the estimated
compileK(D, r, weights = NULL, denom = 1,
check = TRUE, ratio = FALSE, fname = "K")compilepcf(D, r, weights = NULL, denom = 1,
check = TRUE, endcorrect = TRUE, ratio=FALSE,
…, fname = "g")
A square matrix giving the distances between all pairs of points.
An equally spaced, finely spaced sequence of distance values.
Optional numerical weights for the pairwise distances.
A numeric matrix with the same dimensions as D
.
If absent, the weights are taken to equal 1.
Denominator for the estimator.
A single number, or a numeric vector with the same length
as r
. See Details.
Logical value specifying whether to check that D
is a
valid matrix of pairwise distances.
Logical value indicating whether to store ratio information. See Details.
Optional arguments passed to density.default
controlling the kernel smoothing.
Logical value indicating whether to apply End Correction of
the pair correlation estimate at r=0
.
Character string giving the name of the function being estimated.
An object of class "fv"
representing the estimated function.
These low-level functions construct estimates of
the
These functions are useful for code development and for teaching,
because they perform a common task, and do the housekeeping required to
make an object of class "fv"
that represents the estimated
function. However, they are not very efficient.
compileK
calculates the weighted estimate
of the compilepcf
calculates the weighted estimate of the
pair correlation function,
For a point pattern in two dimensions, the usual denominator
The result is an object of class "fv"
representing the
estimated function. This object has only one column of function
values. Additional columns (such as a column giving the theoretical
value) must be added by the user, with the aid of
bind.fv
.
If ratio=TRUE
, the result also belongs to class "rat"
and has attributes containing the numerator and denominator
of the function estimate. This allows function estimates from
several datasets to be pooled using pool
.
Kest
,
pcf
for definitions of the
bind.fv
to add more columns.
# NOT RUN {
X <- japanesepines
D <- pairdist(X)
Wt <- edge.Ripley(X, D)
lambda <- intensity(X)
a <- (npoints(X)-1) * lambda
r <- seq(0, 0.25, by=0.01)
K <- compileK(D=D, r=r, weights=Wt, denom=a)
g <- compilepcf(D=D, r=r, weights=Wt, denom= a * 2 * pi * r)
# }
Run the code above in your browser using DataLab