ptwise.envelope | R Documentation |
Compute pointwise statistics from the simulated function values in an envelope object.
ptwise.envelope(object,
stats=c("mean", "median", "bias",
"var", "sd", "se", "mse", "rmse",
"confint", "predint"),
...,
level=0.95, transform=NULL, theo=NULL)
bias.envelope(object, theo, CI=TRUE, level=0.95)
RMSE.envelope(object, theo)
object |
An object of class |
stats |
Summary statistic(s) to be calculated. A character string
or character vector (partially matched) selected from the
options given, or a |
... |
Arguments passed to |
level |
Confidence level required for |
transform |
Optional expression (passed to
|
theo |
Function in the R language that evaluates the
true (theoretically expected) value of the
spatial summary function. This is required
if |
CI |
Logical value specifying whether to calculate confidence interval as well as bias. |
These functions compute pointwise summary statistics
from n
spatial summary functions which were
obtained from n
simulated point patterns.
The object
should have been generated by the
function envelope
with the argument savefuns=TRUE
specified.
The function envelope
is normally used to
generate simulation envelopes for a particular spatial summary function,
such as the K
function, by simulating n
realisations
of Complete Spatial Randomness or another model.
However, when envelope
is called with
the argument savefuns=TRUE
, it returns all the individual
summary functions for the n
simulated point patterns.
These individual functions are extracted by ptwise.envelope
which then computes the desired summary statistics.
The argument stats
specifies the desired summary statistics.
It can be a character string, or vector of character strings,
containing any of the following (partially matched):
the pointwise sample mean of the functions
the pointwise sample median of the functions
the pointwise bias of the functions
the pointwise sample variance of the functions
the pointwise sample standard deviation of the functions
the standard error of the pointwise sample mean
the pointwise mean squared error
the pointwise root-mean-squared error
a confidence interval for the true mean
a prediction interval for the function value
For confint
or predint
the argument level
specifies the confidence level.
Alternatively, the argument stats
can be a user-specified
function in the R language, which computes the summary statistic.
It should accept a vector argument and return a single numerical value.
The result is an object of class "fv"
that can be plotted
directly. See the Examples for different styles of plot.
The functions bias.envelope
and RMSE.envelope
are
wrappers for ptwise.envelope
which calculate the bias
and root-mean-square error respectively.
A function value table (object of class "fv"
) containing
some or all of the
following columns
r |
Distance argument |
mean |
Pointwise sample mean |
median |
Pointwise sample median |
bias |
Pointwise estimated bias |
var |
Pointwise sample variance |
sd |
Pointwise sample standard deviation |
se |
Pointwise standard error of pointwise mean |
mse |
Pointwise estimated mean squared error |
rmse |
Pointwise estimated root-mean-squared error |
loci , hici |
Pointwise confidence interval for the true mean |
lopi , hipi |
Pointwise prediction interval for the function value |
, \tilman and \martinH.
ISB.envelope
,
IV.envelope
,
ISE.envelope
,
MISE.envelope
.
E <- envelope(cells, Kest, nsim=20, savefuns=TRUE)
plot(ptwise.envelope(E, c("mean", "confint"), level=0.9))
plot(ptwise.envelope(E, max, na.rm=TRUE))
## statistics for L function
plot(ptwise.envelope(E, c("mean","confint"),
transform=quote(sqrt(./pi)), level=0.9))
## calculate pointwise bias and RMSE
## using the theoretical true value K(r) = pi * r^2
trueK <- function(r) { pi * r^2 }
plot(bias.envelope(E, theo=trueK))
plot(RMSE.envelope(E, theo=trueK))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.