rhohat(object, covariate, ...)## S3 method for class 'ppp':
rhohat(object, covariate, ...,
method=c("ratio", "reweight", "transform"),
smoother=c("kernel", "local"),
dimyx=NULL, eps=NULL,
n = 512, bw = "nrd0", adjust=1, from = NULL, to = NULL,
bwref=bw,
covname, confidence=0.95)
## S3 method for class 'quad':
rhohat(object, covariate, ...,
method=c("ratio", "reweight", "transform"),
smoother=c("kernel", "local"),
dimyx=NULL, eps=NULL,
n = 512, bw = "nrd0", adjust=1, from = NULL, to = NULL,
bwref=bw,
covname, confidence=0.95)
## S3 method for class 'ppm':
rhohat(object, covariate, ...,
method=c("ratio", "reweight", "transform"),
smoother=c("kernel", "local"),
dimyx=NULL, eps=NULL,
n = 512, bw = "nrd0", adjust=1, from = NULL, to = NULL,
bwref=bw,
covname, confidence=0.95)
## S3 method for class 'lpp':
rhohat(object, covariate, ...,
method=c("ratio", "reweight", "transform"),
smoother=c("kernel", "local"),
nd=1000, eps=NULL,
n = 512, bw = "nrd0", adjust=1, from = NULL, to = NULL,
bwref=bw,
covname, confidence=0.95)
## S3 method for class 'lppm':
rhohat(object, covariate, ...,
method=c("ratio", "reweight", "transform"),
smoother=c("kernel", "local"),
nd=1000, eps=NULL,
n = 512, bw = "nrd0", adjust=1, from = NULL, to = NULL,
bwref=bw,
covname, confidence=0.95)
"ppp"
or "lpp"
),
a quadrature scheme (object of class "quad"
)
or a fitted point process model (object of class "ppm"
or "lppm"
).function(x,y)
or a pixel image (object of
class "im"
) providing the values of the covariate at any
location.
Alternatively one of the strings "x"
or "y"
signifying the Cartesian density.default
).density.default
).density.default
to
control the number and range of values at which the function
will be estimated.bw
to use when smoothing
the reference density (the density of the covariate values
observed at all locations in the window).density.default
or locfit
."fv"
)
containing the estimated values of $\rho$ for a sequence
of values of $Z$.
Also belongs to the class "rhohat"
which has special methods for print
, plot
and predict
.quadratcount(X, tess=covariate)
object
is a point pattern, this command assumes that
object
is a realisation of a Poisson point process with
intensity function $\lambda(u)$ of the form
$$\lambda(u) = \rho(Z(u))$$ where
$Z$ is the spatial covariate function given by covariate
,
and $\rho(z)$ is a function to be estimated.
This command computes estimators of $\rho(z)$
proposed by Baddeley and Turner (2005)
and Baddeley et al (2012).The covariate $Z$ must have continuous values.
If object
is a fitted point process model, suppose X
is
the original data point pattern to which the model was fitted. Then
this command assumes X
is a realisation of a Poisson point
process with intensity function of the form
$$\lambda(u) = \rho(Z(u)) \kappa(u)$$
where $\kappa(u)$ is the intensity of the fitted model
object
. A smoothing estimator of $\rho(z)$ is computed.
The estimation procedure is determined by the character strings
method
and smoother
.
The estimation procedure involves computing several density estimates
and combining them.
The algorithm used to compute density estimates is
determined by smoother
:
smoother="kernel"
,
each the smoothing procedure is based on
fixed-bandwidth kernel density estimation,
performed bydensity.default
.smoother="local"
, the smoothing procedure
is based on local likelihood density estimation, performed bylocfit
.method
determines how the density estimates will be
combined to obtain an estimate of $\rho(z)$:
method="ratio"
, then$\rho(z)$is
estimated by the ratio of two density estimates.
The numerator is a (rescaled) density estimate obtained by
smoothing the values$Z(y_i)$of the covariate$Z$observed at the data points$y_i$. The denominator
is a density estimate of the reference distribution of$Z$.method="reweight"
, then$\rho(z)$is
estimated by applying density estimation to the
values$Z(y_i)$of the covariate$Z$observed at the data points$y_i$,
with weights inversely proportional to the reference density of$Z$.method="transform"
,
the smoothing method is variable-bandwidth kernel
smoothing, implemented by applying the Probability Integral Transform
to the covariate values, yielding values in the range 0 to 1,
then applying edge-corrected density estimation on the interval$[0,1]$, and back-transforming. The covariate will be evaluated on a fine grid of locations,
with spatial resolution controlled by the arguments
dimyx,eps,nd
.
In two dimensions (i.e.
if object
is of class "ppp"
, "ppm"
or
"quad"
) the arguments dimyx, eps
are
passed to as.mask
to control the pixel
resolution. On a linear network (i.e. if object
is of class
"lpp"
or "lppm"
) the argument nd
specifies the
total number of test locations on the linear
network, and eps
specifies the linear separation between test
locations.
rho2hat
,
methods.rhohat
,
parres
X <- rpoispp(function(x,y){exp(3+3*x)})
rho <- rhohat(X, "x")
rho <- rhohat(X, function(x,y){x})
plot(rho)
curve(exp(3+3*x), lty=3, col=2, add=TRUE)
rhoB <- rhohat(X, "x", method="reweight")
rhoC <- rhohat(X, "x", method="transform")
fit <- ppm(X, ~x)
rr <- rhohat(fit, "y")
# linear network
Y <- runiflpp(30, simplenet)
rhoY <- rhohat(Y, "y")
Run the code above in your browser using DataLab