returnlevelplot {RobAStBase} | R Documentation |
Methods for Function returnlevelplot in Package ‘RobAStBase’
Description
We generalize function returnlevelplot
from package distrMod to
be applicable to distribution and probability model objects. In this context,
returnlevelplot
produces a rescaled QQ plot of data (argument x
)
against a (model) distribution. For arguments y
of class RobModel
,
points at a high “distance” to the model
are plotted smaller. For arguments y
of class kStepEstimate
,
points at with low weight in the [p]IC are plotted bigger and their
color gets faded out slowly. This parallels the behaviour of the respective
qqplot
methods.
Graphical parameters may be given as arguments to returnlevelplot
.
Usage
returnlevelplot(x, y, ...)
## S4 method for signature 'ANY,RobModel'
returnlevelplot(x, y,
n = length(x), withIdLine = TRUE, withConf = TRUE,
withConf.pw = withConf, withConf.sim = withConf,
plot.it = TRUE, xlab = deparse(substitute(x)),
ylab = deparse(substitute(y)), ..., distance = NormType(),
n.adj = TRUE)
## S4 method for signature 'ANY,InfRobModel'
returnlevelplot(x, y, n = length(x), withIdLine = TRUE,
withConf = TRUE, withConf.pw = withConf, withConf.sim = withConf,
plot.it = TRUE, xlab = deparse(substitute(x)), ylab =
deparse(substitute(y)), ..., cex.pts.fun = NULL, n.adj = TRUE)
## S4 method for signature 'ANY,kStepEstimate'
returnlevelplot(x, y,
n = length(x), withIdLine = TRUE, withConf = TRUE,
withConf.pw = withConf, withConf.sim = withConf,
plot.it = TRUE, xlab = deparse(substitute(x)),
ylab = deparse(substitute(y)), ...,
exp.cex2.lbs = -.15,
exp.cex2.pts = -.35,
exp.fadcol.lbs = 1.85,
exp.fadcol.pts = 1.85,
bg = "white")
Arguments
x |
data to be checked for compatibility with distribution/model |
y |
object of class |
n |
numeric; number of quantiles at which to do the comparison. |
withIdLine |
logical; shall line |
withConf |
logical; shall confidence lines be plotted? |
withConf.pw |
logical; shall pointwise confidence lines be plotted? |
withConf.sim |
logical; shall simultaneous confidence lines be plotted? |
plot.it |
logical; shall be plotted at all (inherited from
|
xlab |
x-label |
ylab |
y-label |
... |
further parameters for method |
cex.pts.fun |
rescaling function for the size of the points to be plotted;
either |
n.adj |
logical; shall sample size be adjusted for possible outliers according to radius of the corresponding neighborhood? |
distance |
a function mapping observations |
exp.cex2.lbs |
for objects |
exp.cex2.pts |
for objects |
exp.fadcol.lbs |
for objects |
exp.fadcol.pts |
for objects |
bg |
background color to fade against |
Details
- returnlevelplot
signature(x = "ANY", y = "RobModel")
: produces a QQ plot of a datasetx
against the theoretical quantiles of distribution of robust modely
.- returnlevelplot
signature(x = "ANY", y = "InfRobModel")
: produces a QQ plot of a datasetx
against the theoretical quantiles of distribution of infinitesimally robust modely
.- returnlevelplot
signature(x = "ANY", y = "kStepEstimate")
: produces a QQ plot of a datasetx
against the theoretical quantiles of the model distribution of model at which the correspondingkStepEstimate
y
had been calibrated at. By default, if the [p]IC of thekStepEstimate
is of classHampIC
, i.e.; has a corresponding weight function, points (and, ifwithLab==TRUE
, labels) are scaled and faded according to this weight function. Corresponding argumentsexp.cex2.pts
andexp.fadcol.pts
control this scaling and fading, respectively (and analogouslyexp.cex2.lbs
andexp.fadcol.lbs
for the labels). The choice of these arguments has to be done on a case-by-case basis. Positive exponents induce fading, magnification with increasing weight, for negative exponents the same is true for decreasing weight; higher (absolute) values increase the speed of fading / magnification.
Value
As for function returnlevelplot
from package stats.
Note
The confidence bands given in our version of the return level plot differ from the ones given in package ismev. We use non-parametric bands, hence also allow for non-parametric deviances from the model, whereas in in package ismev they are based on profiling, hence only check for variability within the parametric class.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
ismev: An Introduction to Statistical Modeling of Extreme Values. R package version 1.39. https://CRAN.R-project.org/package=ismev; original S functions written by Janet E. Heffernan with R port and R documentation provided by Alec G. Stephenson. (2012).
Coles, S. (2001). An introduction to statistical modeling of extreme values. London: Springer.
See Also
qqplot
from package stats – the standard QQ plot
function, returnlevelplot
from package distrMod (which
is called intermediately by this method), as well as
qqbounds
, used by returnlevelplot
to produce confidence
intervals.
Examples
returnlevelplot(rnorm(40, mean = 15, sd = sqrt(30)), Chisq(df=15))
RobM <- InfRobModel(center = NormLocationFamily(mean=13,sd=sqrt(28)),
neighbor = ContNeighborhood(radius = 0.4))
## \donttest to reduce check time
x <- rnorm(20, mean = 15, sd = sqrt(30))
returnlevelplot(x, RobM)
returnlevelplot(x, RobM, alpha.CI=0.9, add.points.CI=FALSE)
## further examples for ANY,kStepEstimator-method
## in example to roptest() in package ROptEst