Version: | 1.2.7 |
Date: | 2025-01-12 |
Title: | Robust Asymptotic Statistics |
Description: | Base S4-classes and functions for robust asymptotic statistics. |
Depends: | R(≥ 3.4), methods, rrcov, distr(≥ 2.8.0), distrEx(≥ 2.8.0), distrMod(≥ 2.8.1), RandVar(≥ 1.2.0) |
Suggests: | ROptEst(≥ 1.2.0), RUnit(≥ 0.4.26) |
Imports: | startupmsg(≥ 1.0.0), graphics, grDevices, stats |
ByteCompile: | yes |
License: | LGPL-3 |
Encoding: | UTF-8 |
URL: | https://r-forge.r-project.org/projects/robast/ |
LastChangedDate: | {$LastChangedDate: 2025-01-12 01:18:06 +0100 (So, 12. Jan 2025) $} |
LastChangedRevision: | {$LastChangedRevision: 1322 $} |
VCS/SVNRevision: | 1321 |
NeedsCompilation: | no |
Packaged: | 2025-01-12 14:53:35 UTC; kohlm |
Author: | Matthias Kohl [cre, cph, aut], Peter Ruckdeschel [aut, cph], Mykhailo Pupashenko [ctb] (contributed wrapper functions for diagnostic plots), Gerald Kroisandt [ctb] (contributed testing routines), R Core Team [ctb, cph] (for source file 'format.perc') |
Maintainer: | Matthias Kohl <Matthias.Kohl@stamats.de> |
Repository: | CRAN |
Date/Publication: | 2025-01-14 18:30:01 UTC |
Robust Asymptotic Statistics
Description
Base S4-classes and functions for robust asymptotic statistics.
Details
Package: | RobAStBase |
Version: | 1.2.7 |
Date: | 2025-01-12 |
Depends: | R(>= 3.4), methods, rrcov, distr(>= 2.8.0), distrEx(>= 2.8.0), distrMod(>= 2.8.1),RandVar(>= 1.2.0) |
Suggests: | ROptEst(>= 1.2.0), RUnit(>= 0.4.26) |
Imports: | startupmsg(>= 1.0.0), graphics, grDevices, stats |
ByteCompile: | yes |
Encoding: | latin1 |
License: | LGPL-3 |
URL: | https://r-forge.r-project.org/projects/robast/ |
VCS/SVNRevision: | 1321 |
Package versions
Note: The first two numbers of package versions do not necessarily reflect package-individual development, but rather are chosen for the RobAStXXX family as a whole in order to ease updating "depends" information.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de,
Matthias Kohl Matthias.Kohl@stamats.de
Maintainer: Matthias Kohl matthias.kohl@stamats.de
References
M. Kohl (2005). Numerical Contributions to the Asymptotic Theory of Robustness. Dissertation. University of Bayreuth. See also https://www.stamats.de/wp-content/uploads/2018/04/ThesisMKohl.pdf
See Also
distr-package
,
distrEx-package
,
distrMod-package
Examples
library(RobAStBase)
## some L2 differentiable parametric family from package distrMod, e.g.
B <- BinomFamily(size = 25, prob = 0.25)
## classical optimal IC
IC0 <- optIC(model = B, risk = asCov())
plot(IC0) # plot IC
checkIC(IC0, B)
Merging Lists
Description
.merge.lists
takes two lists and merges them.
Usage
.merge.lists(a, b)
Arguments
a |
the first list |
b |
the second list |
Value
the merged list
ALEstimate-class.
Description
Class of asymptotically linear estimates.
Details
The (return value) class of an estimator is of class ALEstimate
if it is asymptotically linear; then it has an influence function
(implemented in slot pIC
) and so all the diagnostics for influence
functions are available; in addition it is asymptotically normal, so
we can (easily) deduce asymptotic covariances, hence may use these
in confidence intervals; in particular, the return values of kStepEstimator
oneStepEstimator
(and roptest
, robest
, RMXEstimator
,
MBREstimator
, OBREstimator
, OMSEstimator
in package
'ROptEst') are objects of (subclasses of) this class.
As the return value of CvMMDEEstimator
(or MDEstimator
with
CvMDist
or CvMDist2
as distance) is asymptotically linear,
there is class MCALEstimate
extending MCEstimate
by
extra slots pIC
and asbias
(only filled optionally with
non-NULL
values). Again all the diagnostics for influence
functions are then available. Classes ML.ALEstimate
and
class CvMMD.ALEstimate
are nominal subclasses of class
MCALEstimate
, nominal in the sense that they have no extra slots,
but they might have particular methods later on.
Helper method getPIC
by means of the estimator class, and, in
case of estimators of class CvMMDEstimate
, also the name
(in slot name
) produces the (partial) influence function:
calling .CvMMDCovariance
– either directly or through wrapper
.CvMMDCovarianceWithMux
. This is used in the corresponding
.checkEstClassForParamFamily
method, which coerces object
from
class "MCEstimate"
to "MCALEstimate"
.
Objects from the Class
Objects can be created by calls of the form new("ALEstimate", ...)
.
Slots
name
Object of class
"character"
: name of the estimator.estimate
Object of class
"ANY"
: estimate.estimate.call
Object of class
"call"
: call by which estimate was produced.samplesize
object of class
"numeric"
— the samplesize (only complete cases are counted) at which the estimate was evaluated.completecases
object of class
"logical"
— complete cases at which the estimate was evaluated.asvar
object of class
"OptionalNumericOrMatrix"
which may contain the asymptotic (co)variance of the estimator.asbias
Optional object of class
"numeric"
: asymptotic bias.pIC
Optional object of class
InfluenceCurve
: influence curve.nuis.idx
object of class
"OptionalNumeric"
: indices ofestimate
belonging to the nuisance part.fixed
object of class
"OptionalNumeric"
: the fixed and known part of the parameterInfos
object of class
"matrix"
with two columns namedmethod
andmessage
: additional informations.trafo
object of class
"list"
: a list with componentsfct
andmat
(see below).untransformed.estimate
Object of class
"ANY"
: untransformed estimate.untransformed.asvar
object of class
"OptionalNumericOrMatrix"
which may contain the asymptotic (co)variance of the untransformed estimator.
Extends
Class ALEstimate
extends class "Estimate"
, directly.
Class MCALEstimate
extends classes
"ALEstimate"
, and "MCEstimate"
directly.
Class ML.ALEstimate
extends classes
"ALEstimate"
, and "MLEstimate"
directly.
Class CvM.ALEstimate
extends classes
"ALEstimate"
, and "CvMMDEstimate"
directly.
The last two classes are to be used for method dispatch, later;
they have an identical slot structure to class MCALEstimate
.
Methods
- pIC
signature(object = "ALEstimate")
: accessor function for slotpIC
.- show
signature(object = "ALEstimate")
- confint
signature(object = "ALEstimate", method = "missing")
: compute asymptotic (LAN-based) confidence interval neglecting any bias.- confint
signature(object = "ALEstimate", method = "symmetricBias")
: compute asymptotic (LAN-based) confidence interval incorporating bias symmetrically.- confint
signature(object = "ALEstimate", method = "onesidedBias")
: compute asymptotic (LAN-based) confidence interval incorporating bias one-sided; i.e., positive or negative, respectively.- confint
signature(object = "ALEstimate", method = "asymmetricBias")
: compute asymptotic (LAN-based) confidence interval incorporating bias asymmetrically.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de and Peter Ruckdeschel Peter.Ruckdeschel@uni-oldenburg.de
See Also
Examples
## prototype
new("ALEstimate")
## data example
set.seed(123)
x <- rgamma(50, scale = 0.5, shape = 3)
## parametric family of probability measures
G <- GammaFamily(scale = 1, shape = 2)
mle <- MLEstimator(x,G)
(picM <- pIC(mle))
## Kolmogorov(-Smirnov) minimum distance estimator
ke <- KolmogorovMDEstimator(x = x, ParamFamily = G)
pIC(ke) ## gives NULL
## von Mises minimum distance estimator with default mu
## to save time for CRAN
system.time(me <- CvMMDEstimator(x = x, ParamFamily = G))
str(me@pIC) ## a call
system.time(pIC0 <- pIC(me))
str(me@pIC) ## now filled
Robust Weight classes for bounded, standardized weights
Description
Classes for bounded, robust, standardized weights.
Objects from the Class
Objects can be created by calls of the form new("BdStWeight", ...)
;
to fill slot weight
, you will use the generating functions
getweight
and minbiasweight
.
Slots
name
Object of class
"character"
; inherited from classRobWeight
.weight
Object of class
"function"
— the weight function; inherited from classRobWeight
.clip
Object of class
"numeric"
— clipping bound(s); inherited from classBoundedWeight
.stand
Object of class
"matrix"
— standardization.
Extends
Class "RobWeight"
, via class "BoundedWeight"
.
Class "BoundedWeight"
, directly.
Methods
- stand
signature(object = "BdStWeight")
: accessor function for slotstand
.- stand<-
signature(object = "BdStWeight", value = "matrix")
: replacement function for slotstand
. This replacement method should be used with great care, as the slotweight
is not simultaneously updated and hence, this may lead to inconsistent objects.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
BoundedWeight-class
, RobWeight-class
,
IC
, InfluenceCurve-class
Examples
## prototype
new("BdStWeight")
Robust Weight classes for bounded weights
Description
Classes for bounded, robust weights.
Objects from the Class
Objects can be created by calls of the form new("BoundedWeight", ...)
.
Slots
name
Object of class
"character"
; inherited from classRobWeight
.weight
Object of class
"function"
— the weight function; inherited from classRobWeight
.clip
Object of class
"numeric"
— clipping bound(s).
Extends
Class "RobWeight"
, directly.
Methods
- clip
signature(x1 = "BoundedWeight")
: accessor function for slotclip
.- clip<-
signature(object = "BoundedWeight", value = "numeric")
: replacement function for slotclip
. This replacement method should be used with great care, as the slotweight
is not simultaneously updated and hence, this may lead to inconsistent objects.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
RobWeight-class
, IC
, InfluenceCurve-class
Examples
## prototype
new("BoundedWeight")
Wrapper function for function comparePlot
Description
The wrapper ComparePlot
(capital C!) takes most of arguments
to function comparePlot
(lower case c!) by default and gives a user
possibility to run the function with low number of arguments.
Usage
ComparePlot(IC1, IC2, y, ..., IC3 = NULL, IC4 = NULL,
alpha.trsp = 100, with.legend = TRUE, rescale = FALSE,
withCall = TRUE)
Arguments
IC1 |
object of class |
IC2 |
object of class |
IC3 |
object of class |
IC4 |
object of class |
y |
optional data argument — for plotting observations into the plot |
... |
additional parameters (in particular to be
passed on to |
alpha.trsp |
the transparency argument (0 to 100) for ploting the data |
with.legend |
the flag for showing the legend of the plot |
rescale |
the flag for rescaling the axes for better view of the plot |
withCall |
the flag for the call output |
Value
invisible(retV)
where retV
is the return value
of the respective call to the full-fledged function comparePlot
with the additional item wrapcall
with the call
to the wrapper ComparePlot
and wrappedcall
the call to
to the full-fledged function comparePlot
.
Details
Calls comparePlot
with suitably chosen defaults;
if withCall == TRUE
, the call to
comparePlot
, i.e., item wrappedcall
of the (hidden)
return value, is printed.
Examples
# Gamma
fam <- GammaFamily()
rfam <- InfRobModel(fam, ContNeighborhood(0.5))
IC1 <- optIC(model = fam, risk = asCov())
IC2 <- makeIC(list(function(x)sin(x),function(x)x^2), L2Fam = fam)
Y <- distribution(fam)
y <- r(Y)(100)
ComparePlot(IC1, IC2, y, withCall = TRUE)
Generating function for ContIC-class
Description
Generates an object of class "ContIC"
;
i.e., an influence curves \eta
of the form
\eta = (A\Lambda - a)\min(1,b/|A\Lambda - a|)
with clipping bound b
, centering constant a
and
standardizing matrix A
. \Lambda
stands for
the L2 derivative of the corresponding L2 differentiable
parametric family which can be created via CallL2Fam
.
Usage
ContIC(name, CallL2Fam = call("L2ParamFamily"),
Curve = EuclRandVarList(RealRandVariable(Map = c(function(x){x}),
Domain = Reals())),
Risks, Infos, clip = Inf, cent = 0, stand = as.matrix(1),
lowerCase = NULL, neighborRadius = 0, w = new("HampelWeight"),
normtype = NormType(), biastype = symmetricBias(),
modifyIC = NULL)
Arguments
name |
object of class |
CallL2Fam |
object of class |
Curve |
object of class |
Risks |
object of class |
Infos |
matrix of characters with two columns
named |
clip |
positive real: clipping bound. |
cent |
real: centering constant |
stand |
matrix: standardizing matrix |
w |
HampelWeight: weight object |
lowerCase |
optional constant for lower case solution. |
neighborRadius |
radius of the corresponding (unconditional) contamination neighborhood. |
biastype |
BiasType: type of the bias |
normtype |
NormType: type of the norm |
modifyIC |
object of class |
Value
Object of class "ContIC"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
IC-class
, ContIC
, HampIC-class
Examples
IC1 <- ContIC()
plot(IC1)
Influence curve of contamination type
Description
Class of (partial) influence curves of contamination type;
i.e., influence curves \eta
of the form
\eta = (A\Lambda - a)\min(1,b/|A\Lambda - a|)
with clipping bound b
, centering constant a
and
standardizing matrix A
. \Lambda
stands for
the L2 derivative of the corresponding L2 differentiable
parametric family created via the call in the slot CallL2Fam
.
Objects from the Class
Objects can be created by calls of the form new("ContIC", ...)
.
More frequently they are created via the generating function
ContIC
, respectively via the method generateIC
.
Slots
CallL2Fam
:object of class
"call"
: creates an object of the underlying L2-differentiable parametric family.name
:object of class
"character"
Curve
:object of class
"EuclRandVarList"
modifyIC
object of class
"OptionalFunction"
: function of four arguments: (1)L2Fam
an L2 parametric family (2)IC
an optional influence curve, (3)withMakeIC
a logical argument whether to enforce the IC side conditions bymakeIC
, and (4)...
for arguments to be passed to calls toE
inmakeIC
. Returns an object of class"IC"
. This function is mainly used for internal computations!Risks
:object of class
"list"
: list of risks; cf.RiskType-class
.Infos
:object of class
"matrix"
with two columns namedmethod
andmessage
: additional informations.clip
:object of class
"numeric"
: clipping bound.cent
:object of class
"numeric"
: centering constant.stand
:object of class
"matrix"
: standardizing matrix.weight
:object of class
"HampelWeight"
: weight functionbiastype
:object of class
"BiasType"
: bias type (symmetric/onsided/asymmetric)normtype
:object of class
"NormType"
: norm type (Euclidean, information/self-standardized)lowerCase
:object of class
"OptionalNumeric"
: optional constant for lower case solution.neighborRadius
:object of class
"numeric"
: radius of the corresponding (unconditional) contamination neighborhood.
Extends
Class "HampIC"
, directly.
Class "IC"
, by class "HampIC"
.
Class "InfluenceCurve"
, by class "IC"
.
Methods
- CallL2Fam<-
signature(object = "ContIC")
: replacement function for slotCallL2Fam
.- cent
signature(object = "ContIC")
: accessor function for slotcent
.- cent<-
signature(object = "ContIC")
: replacement function for slotcent
.- clip
signature(x1 = "ContIC")
: accessor function for slotclip
.- clip<-
signature(object = "ContIC")
: replacement function for slotclip
.- stand<-
signature(object = "ContIC")
: replacement function for slotstand
.- lowerCase<-
signature(object = "ContIC")
: replacement function for slotlowerCase
.- neighbor
signature(object = "ContIC")
: generates an object of class"ContNeighborhood"
with radius given in slotneighborRadius
.- generateIC
signature(neighbor = "ContNeighborhood", L2Fam = "L2ParamFamily")
: generate an object of class"ContIC"
. Rarely called directly.- show
signature(object = "ContIC")
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
IC1 <- new("ContIC")
plot(IC1)
Generating function for ContNeighborhood-class
Description
Generates an object of class "ContNeighborhood"
.
Usage
ContNeighborhood(radius = 0)
Arguments
radius |
non-negative real: neighborhood radius. |
Value
Object of class "ContNeighborhood"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
ContNeighborhood()
## The function is currently defined as
function(radius = 0){
new("ContNeighborhood", radius = radius)
}
Contamination Neighborhood
Description
Class of (unconditional) contamination neighborhoods.
Objects from the Class
Objects can be created by calls of the form new("ContNeighborhood", ...)
.
More frequently they are created via the generating function
ContNeighborhood
.
Slots
type
Object of class
"character"
: “(uncond.) convex contamination neighborhood”.radius
Object of class
"numeric"
: neighborhood radius.
Extends
Class "UncondNeighborhood"
, directly.
Class "Neighborhood"
, by class "UncondNeighborhood"
.
Methods
No methods defined with class "ContNeighborhood" in the signature.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
ContNeighborhood
, UncondNeighborhood-class
Examples
new("ContNeighborhood")
Generating function for FixRobModel-class
Description
Generates an object of class "FixRobModel"
.
Usage
FixRobModel(center = ParamFamily(modifyParam =
function(theta) Norm(mean = theta)), neighbor = ContNeighborhood())
Arguments
center |
object of class |
neighbor |
object of class |
Value
Object of class "FixRobModel"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
(M1 <- FixRobModel())
## The function is currently defined as
function(center = ParamFamily(), neighbor = ContNeighborhood()){
new("FixRobModel", center = center, neighbor = neighbor)
}
Robust model with fixed (unconditional) neighborhood
Description
Class of robust models with fixed (unconditional) neighborhoods.
Objects from the Class
Objects can be created by calls of the form new("FixRobModel", ...)
.
More frequently they are created via the generating function
FixRobModel
.
Slots
center
Object of class
"ProbFamily"
.neighbor
Object of class
"UncondNeighborhood"
.
Extends
Class "RobModel"
, directly.
Methods
- neighbor<-
signature(object = "FixRobModel")
: replacement function for slotneighbor<-
- show
signature(object = "FixRobModel")
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
ProbFamily-class
, UncondNeighborhood-class
,
FixRobModel
Examples
new("FixRobModel")
Influence curve of Hampel type
Description
Class of (partial) influence curves of Hampel (= total variation or contamination) type;
used as common mother class for classes ContIC
and TotalVarIC
.
Objects from the Class
Objects can be created by calls of the form new("HampIC", ...)
.
Slots
CallL2Fam
object of class
"call"
: creates an object of the underlying L2-differentiable parametric family.name
object of class
"character"
Curve
object of class
"EuclRandVarList"
modifyIC
object of class
"OptionalFunction"
: function of four arguments: (1)L2Fam
an L2 parametric family (2)IC
an optional influence curve, (3)withMakeIC
a logical argument whether to enforce the IC side conditions bymakeIC
, and (4)...
for arguments to be passed to calls toE
inmakeIC
. Returns an object of class"IC"
. This function is mainly used for internal computations!Risks
object of class
"list"
: list of risks; cf.RiskType-class
.Infos
object of class
"matrix"
with two columns namedmethod
andmessage
: additional informations.stand
object of class
"matrix"
: standardizing matrix.weight
object of class
"RobWeight"
: weight functionbiastype
object of class
"BiasType"
: bias type (symmetric/onsided/asymmetric)normtype
object of class
"NormType"
: norm type (Euclidean, information/self-standardized)lowerCase
object of class
"OptionalNumeric"
: optional constant for lower case solution.neighborRadius
object of class
"numeric"
: radius of the corresponding (unconditional) contamination neighborhood.
Extends
Class "IC"
, directly.
Class "InfluenceCurve"
, by class "IC"
.
Methods
- stand
signature(object = "HampIC")
: accessor function for slotstand
.- weight
signature(object = "HampIC")
: accessor function for slotweight
.- biastype
signature(object = "HampIC")
: accessor function for slotbiastype
.- normtype
signature(object = "HampIC")
: accessor function for slotnormtype
.- lowerCase
signature(object = "HampIC")
: accessor function for slotlowerCase
.- neighborRadius
signature(object = "HampIC")
: accessor function for slotneighborRadius
.- neighborRadius<-
signature(object = "HampIC")
: replacement function for slotneighborRadius
.- neighborRadius
signature(object = "ANY")
: returnsNULL
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Hampributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
IC1 <- new("HampIC")
plot(IC1)
Robust Weight classes for weights of Hampel type
Description
Classes for weights of Hampel type.
Objects from the Class
Objects can be created by calls of the form new("HampelWeight", ...)
;
to fill slot weight
, you will use the generating functions
getweight
and minbiasweight
.
Slots
name
Object of class
"character"
; inherited from classRobWeight
.weight
Object of class
"function"
— the weight function; inherited from classRobWeight
.clip
Object of class
"numeric"
— clipping bound(s); inherited from classBoundedWeight
.stand
Object of class
"matrix"
— standardization; inherited from classBdStWeight
.cent
Object of class
"numeric"
— centering.
Extends
Class "RobWeight"
, via class "BoundedWeight"
.
Class "BoundedWeight"
, via class "BdStWeight"
.
Class "BdStWeight"
, directly.
Methods
- cent
signature(object = "HampelWeight")
: accessor function for slotcent
.- cent<-
signature(object = "HampelWeight", value = "matrix")
: replacement function for slotcent
. This replacement method should be used with great care, as the slotweight
is not simultaneously updated and hence, this may lead to inconsistent objects.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
BdStWeight-class
,
BoundedWeight-class
, RobWeight-class
,
IC
, InfluenceCurve-class
Examples
## prototype
new("HampelWeight")
Generating function for IC-class
Description
Generates an object of class "IC"
.
Usage
IC(name, Curve = EuclRandVarList(RealRandVariable(Map = list(function(x){x}),
Domain = Reals())),
Risks, Infos, CallL2Fam = call("L2ParamFamily"), modifyIC = NULL)
Arguments
name |
Object of class |
CallL2Fam |
object of class |
Curve |
object of class |
Risks |
object of class |
Infos |
matrix of characters with two columns
named |
modifyIC |
object of class |
Value
Object of class "IC"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
IC1 <- IC()
plot(IC1)
Influence curve
Description
Class of (partial) influence curves.
Objects from the Class
Objects can be created by calls of the form new("IC", ...)
.
More frequently they are created via the generating function
IC
.
Slots
CallL2Fam
Object of class
"call"
: creates an object of the underlying L2-differentiable parametric family.modifyIC
object of class
"OptionalFunction"
: function of four arguments: (1)L2Fam
an L2 parametric family (2)IC
an optional influence curve, (3)withMakeIC
a logical argument whether to enforce the IC side conditions bymakeIC
, and (4)...
for arguments to be passed to calls toE
inmakeIC
. Returns an object of class"IC"
. This function is mainly used for internal computations!name
Object of class
"character"
.Curve
Object of class
"EuclRandVarList"
.Risks
Object of class
"list"
: list of risks; cf.RiskType-class
.Infos
Object of class
"matrix"
with two columns namedmethod
andmessage
: additional informations.
Extends
Class "InfluenceCurve"
, directly.
Methods
- CallL2Fam
signature(object = "IC")
: accessor function for slotCallL2Fam
.- CallL2Fam<-
signature(object = "IC")
: replacement function for slotCallL2Fam
.- modifyIC
signature(object = "IC")
: accessor function for slotmodifyIC
.- checkIC
signature(IC = "IC", L2Fam = "missing")
: check centering and Fisher consistency ofIC
assuming the L2-differentiable parametric family which can be generated via the slotCallL2Fam
ofIC
.- checkIC
signature(IC = "IC", L2Fam = "L2ParamFamily")
: check centering and Fisher consistency ofIC
assuming the L2-differentiable parametric familyL2Fam
.- evalIC
signature(IC = "IC", x = "numeric")
: evaluateIC
atx
.- evalIC
signature(IC = "IC", x = "matrix")
: evaluateIC
at the rows ofx
.- infoPlot
signature(object = "IC")
: Plot absolute and relative information ofIC
.- plot
signature(x = "IC", y = "missing")
- show
signature(object = "IC")
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
IC1 <- new("IC")
plot(IC1)
Generating function for InfRobModel-class
Description
Generates an object of class "InfRobModel"
.
Usage
InfRobModel(center = L2ParamFamily(), neighbor = ContNeighborhood())
Arguments
center |
object of class |
neighbor |
object of class |
Value
Object of class "FixRobModel"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
RobModel-class
, FixRobModel-class
Examples
(M1 <- InfRobModel())
## The function is currently defined as
function(center = L2ParamFamily(), neighbor = ContNeighborhood()){
new("InfRobModel", center = center, neighbor = neighbor)
}
Robust model with infinitesimal (unconditional) neighborhood
Description
Class of robust models with infinitesimal (unconditional) neighborhoods;
i.e., the neighborhood is shrinking at a rate of \sqrt{n}
.
Objects from the Class
Objects can be created by calls of the form new("InfRobModel", ...)
.
More frequently they are created via the generating function
InfRobModel
.
Slots
center
Object of class
"ProbFamily"
.neighbor
Object of class
"UncondNeighborhood"
.
Extends
Class "RobModel"
, directly.
Methods
- neighbor<-
signature(object = "InfRobModel")
: replacement function for slotneighbor<-
- show
signature(object = "InfRobModel")
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
ProbFamily-class
, UncondNeighborhood-class
,
InfRobModel
Examples
new("InfRobModel")
Generating function for InfluenceCurve-class
Description
Generates an object of class "InfluenceCurve"
.
Usage
InfluenceCurve(name, Curve = EuclRandVarList(EuclRandVariable(Domain = Reals())),
Risks, Infos)
Arguments
name |
character string: name of the influence curve |
Curve |
object of class |
Risks |
list of risks |
Infos |
matrix of characters with two columns
named |
Value
Object of class "InfluenceCurve"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
InfluenceCurve()
## The function is currently defined as
InfluenceCurve <- function(name, Curve = EuclRandVarList(EuclRandVariable(Domain = Reals())),
Risks, Infos){
if(missing(name))
name <- "influence curve"
if(missing(Risks))
Risks <- list()
if(missing(Infos))
Infos <- matrix(c(character(0),character(0)), ncol=2,
dimnames=list(character(0), c("method", "message")))
return(new("InfluenceCurve", name = name, Curve = Curve,
Risks = Risks, Infos = Infos))
}
Influence curve
Description
Class of influence curves (functions).
Objects from the Class
Objects can be created by calls of the form new("InfluenceCurve", ...)
.
More frequently they are created via the generating function
InfluenceCurve
.
Slots
name
object of class
"character"
Curve
object of class
"EuclRandVarList"
Risks
object of class
"list"
: list of risks; cf.RiskType-class
.Infos
object of class
"matrix"
with two columns namedmethod
andmessage
: additional informations.
Methods
- name
signature(object = "InfluenceCurve")
: accessor function for slotname
.- name<-
signature(object = "InfluenceCurve")
: replacement function for slotname
.- Curve
signature(object = "InfluenceCurve")
: accessor function for slotCurve
.- Map
signature(object = "InfluenceCurve")
: accessor function for slotMap
of slotCurve
.- Domain
signature(object = "InfluenceCurve")
: accessor function for slotDomain
of slotCurve
.- Range
signature(object = "InfluenceCurve")
: accessor function for slotRange
of slotCurve
.- Infos
signature(object = "InfluenceCurve")
: accessor function for slotInfos
.- Infos<-
signature(object = "InfluenceCurve")
: replacement function for slotInfos
.- addInfo<-
signature(object = "InfluenceCurve")
: function to add an information to slotInfos
.- Risks
signature(object = "InfluenceCurve")
: accessor function for slotRisks
. By means of internal function.evalListRec
recursively evaluates all non evaluated calls and writes back the evaluated calls to the calling envirionment.- Risks<-
signature(object = "InfluenceCurve")
: replacement function for slotRisks
.- addRisk<-
signature(object = "InfluenceCurve")
: function to add a risk to slotRisks
.- show
signature(object = "InfluenceCurve")
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
InfluenceCurve
, RiskType-class
Examples
new("InfluenceCurve")
Wrapper function for information plot method
Description
The wrapper InfoPlot
(captial I!) takes most of arguments to the plot
method infoPlot
(lower case i!) by default and gives a user possibility to run
the function with low number of arguments.
Usage
InfoPlot(IC, data, ..., alpha.trsp = 100,
with.legend = TRUE, rescale = FALSE, withCall = TRUE)
Arguments
IC |
object of class |
data |
optional data argument — for plotting observations into the plot |
... |
additional parameters (in particular to be
passed on to |
alpha.trsp |
the transparency argument (0 to 100) for ploting the data |
with.legend |
the flag for showing the legend of the plot |
rescale |
the flag for rescaling the axes for better view of the plot |
withCall |
the flag for the call output |
Value
invisible(retV)
where retV
is the return value
of the respective call to the full-fledged function infoPlot
with the additional item wrapcall
with the call
to the wrapper InfoPlot
and wrappedcall
the call to
to the full-fledged function infoPlot
.
Details
Calls infoPlot
with suitably chosen defaults. If
withCall == TRUE
, the call to infoPlot
, i.e.,
item wrappedcall
of the (hidden) return value, is
returned
Examples
# Gamma
fam <- GammaFamily()
IC <- optIC(model = fam, risk = asCov())
Y <- distribution(fam)
data <- r(Y)(500)
InfoPlot(IC, data, withCall = FALSE)
MEstimate-class.
Description
Class of asymptotically linear estimates.
Objects from the Class
Objects can be created by calls of the form new("MEstimate", ...)
.
More frequently they are created via the generating function
locMEstimator
.
Slots
name
Object of class
"character"
: name of the estimator.estimate
Object of class
"ANY"
: estimate.samplesize
Object of class
"numeric"
: sample size.asvar
Optional object of class
"matrix"
: asymptotic variance.asbias
Optional object of class
"numeric"
: asymptotic bias.pIC
Optional object of class
InfluenceCurve
: influence curve.nuis.idx
object of class
"OptionalNumeric"
: indices ofestimate
belonging to the nuisance part.Mroot
Object of class
"numeric"
: value of the M equation at the estimate.Infos
object of class
"matrix"
with two columns namedmethod
andmessage
: additional informations.
Extends
Class "ALEstimate"
, directly.
Class "Estimate"
, by class "ALEstimate"
.
Methods
- Mroot
signature(object = "MEstimate")
: accessor function for slotMroot
.- show
signature(object = "MEstimate")
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
See Also
Examples
## prototype
new("MEstimate")
Neighborhood
Description
Class of neighborhoods of families of probability measures.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
type
Object of class
"character"
: type of the neighborhood.radius
Object of class
"numeric"
: neighborhood radius.
Methods
- type
signature(object = "Neighborhood")
: accessor function for slottype
.- radius
signature(object = "Neighborhood")
: accessor function for slotradius
.- show
signature(object = "Neighborhood")
- radius<-
signature(object = "Neighborhood")
: replacement function for slotradius
.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Some helper Classes in package 'RobAStBase'
Description
Some helper Classes in package 'RobAStBase':
Classes OptionalInfluenceCurve
, OptionalpICList
,
StartClass
, pICList
Class Unions
OptionalInfluenceCurve
is a class union of classes
InfluenceCurve
and NULL
;
OptionalInfluenceCurveOrCall
is a class union of classes
InfluenceCurve
, call
, and NULL
— it is the slot
class of slot pIC
in ALEstimate
;
OptionalpICList
is a class union of classes
pICList
and NULL
— it is the slot
class of slot pICList
in kStepEstimate
;
StartClass
is a class union of classes
function
, numeric
and Estimate
— it is the slot
class of slot start
in kStepEstimate
.
List Classes
pICList
is a descendant of class list
which requires
its members —if any— to be of class pIC
.
Methods
- show
signature(object = "OptionalpICList")
: particular show-method.- show
signature(object = "pICList")
: particular show-method.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
InfluenceCurve
, RiskType-class
Wrapper function for plot method for IC
Description
The wrapper PlotIC
takes most of arguments to the plot
method by default and gives a user possibility to run the function
with low number of arguments.
Usage
PlotIC(IC, y, ..., alpha.trsp = 100, with.legend = TRUE,
rescale = FALSE, withCall = TRUE)
Arguments
IC |
object of class |
y |
optional data argument — for plotting observations into the plot |
... |
additional parameters (in particular to be
passed on to |
alpha.trsp |
the transparency argument (0 to 100) for ploting the data |
with.legend |
the flag for showing the legend of the plot |
rescale |
the flag for rescaling the axes for better view of the plot |
withCall |
the flag for the call output |
Value
invisible(retV)
where retV
is the return value
of the respective call to the full-fledged plot method
with the additional item wrapcall
with the call
to PlotIC
and wrappedcall
the call to
to the full-fledged plot method.
Details
Calls plot
with suitably chosen defaults; if
withCall == TRUE
, the call to plot
, i.e.,
item wrappedcall
from the (hidden) return value, is
printed.
Examples
# Gamma
fam <- GammaFamily()
rfam <- InfRobModel(fam, ContNeighborhood(0.5))
IC <- optIC(model = fam, risk = asCov())
Y <- distribution(fam)
y <- r(Y)(1000)
PlotIC(IC, y, withCall = FALSE)
Masking of/by other functions in package "RobAStBase"
Description
Provides information on the (intended) masking of and (non-intended) masking by other other functions in package RobAStBase
Usage
RobAStBaseMASK(library = NULL)
Arguments
library |
a character vector with path names of R libraries, or |
Value
no value is returned
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
Examples
## IGNORE_RDIFF_BEGIN
RobAStBaseMASK()
## IGNORE_RDIFF_END
Function to change the global variables of the package ‘RobAStBase’
Description
With RobAStBaseOptions
you can inspect and change
the global variables of the package RobAStBase.
Usage
RobAStBaseOptions(...)
getRobAStBaseOption(x)
Arguments
... |
any options can be defined, using name = value or by passing a list of such tagged values. |
x |
a character string holding an option name. |
Value
RobAStBaseOptions()
returns a list of the global variables.
RobAStBaseOptions(x)
returns the global variable x.
getRobAStBaseOption(x)
returns the global variable x.
RobAStBaseOptions(x=y)
sets the value of the global variable x to y.
Global Options
- kStepUseLast:
The default value of argument
kStepUseLast
isFALSE
. Explicitly settingkStepUseLast
toTRUE
should be done with care as in this situation the influence curve in case ofoneStepEstimator
andkStepEstimator
is re-computed using the value of the one- resp. k-step estimate which may take quite a long time depending on the model.- withUpdateInKer:
if there is a non-trivial trafo in the model with matrix
D
, shall the parameter be updated on{\rm ker}(D)
? Defaults toFALSE
.- IC.UpdateInKer:
if there is a non-trivial trafo in the model with matrix
D
, the IC to be used for this; ifNULL
the result ofgetboundedIC(L2Fam,D)
is taken; this IC will then be projected onto{\rm ker}(D)
; defaults toNULL
.- all.verbose:
argument
verbose
passed on by default to many calls ofoptIC
,radiusminimaxIC
,getinfRobIC
etc.; well suited for testing purposes. Defaults toFALSE
.- withPICList:
logical: shall slot
pICList
of return value ofkStepEstimator
be filled? Defaults toFALSE
.- withICList:
logical: shall slot
ICList
of return value ofkStepEstimator
be filled? Defaults toFALSE
.- modifyICwarn:
logical: should a (warning) information be added if
modifyIC
is applied and hence some optimality information could no longer be valid? Defaults toTRUE
.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
See Also
Examples
RobAStBaseOptions()
RobAStBaseOptions("kStepUseLast")
RobAStBaseOptions("kStepUseLast" = TRUE)
# or
RobAStBaseOptions(kStepUseLast = 1e-6)
getRobAStBaseOption("kStepUseLast")
Control classes in package RobAStBase
Description
Control classes in package RobAStBase.
Objects from the Class
This class is virtual; that is no objects may be created.
Slots
name
Object of class
"character"
: name of the control object.
Methods
- name
signature(object = "RobAStControl")
: accessor function for slotname
.- name<-
signature(object = "RobAStControl", value = "character")
: replacement function for slotname
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
Robust model
Description
Class of robust models. A robust model consists
of family of probability measures center
and a
neighborhood neighbor
about this family.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
center
Object of class
"ProbFamily"
neighbor
Object of class
"Neighborhood"
Methods
- center
signature(object = "RobModel")
: accessor function for slotcenter
.- center<-
signature(object = "RobModel")
: replacement function for slotcenter
.- neighbor
signature(object = "RobModel")
: accessor function for slotneighbor
.- neighbor<-
signature(object = "RobModel")
: replacement function for slotneighbor
.- trafo
signature(object = "RobModel", param = "missing")
: accessor function for slottrafo
of slotcenter
.- trafo<-
signature(object = "RobModel")
: replacement function for slottrafo
of slotcenter
.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
ProbFamily-class
, Neighborhood-class
Robust Weight classes
Description
Classes for robust weights.
Objects from the Class
Objects can be created by calls of the form new("RobWeight", ...)
.
Slots
name
Object of class
"character"
.weight
Object of class
"function"
— the weight function.
Methods
- name
signature(object = "RobWeight")
: accessor function for slotname
.- name<-
signature(object = "RobWeight")
: replacement function for slotname
.- weight
signature(object = "RobWeight")
: accessor function for slotweight
.- weight<-
signature(object = "RobWeight")
: replacement function for slotweight
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
## prototype
new("RobWeight")
Generating function for TotalVarIC-class
Description
Generates an object of class "TotalVarIC"
;
i.e., an influence curves \eta
of the form
\eta = c \vee A\Lambda \wedge d
with lower clipping bound c
, upper clipping bound d
and
standardizing matrix A
. \Lambda
stands for
the L2 derivative of the corresponding L2 differentiable
parametric family which can be created via CallL2Fam
.
Usage
TotalVarIC(name, CallL2Fam = call("L2ParamFamily"),
Curve = EuclRandVarList(RealRandVariable(Map = c(function(x) {x}),
Domain = Reals())),
Risks, Infos, clipLo = -Inf, clipUp = Inf, stand = as.matrix(1),
lowerCase = NULL, neighborRadius = 0, w = new("BdStWeight"),
normtype = NormType(), biastype = symmetricBias(),
modifyIC = NULL)
Arguments
name |
object of class |
CallL2Fam |
object of class |
Curve |
object of class |
Risks |
object of class |
Infos |
matrix of characters with two columns
named |
clipLo |
negative real: lower clipping bound. |
clipUp |
positive real: lower clipping bound. |
stand |
matrix: standardizing matrix |
w |
BdStWeight: weight object |
lowerCase |
optional constant for lower case solution. |
neighborRadius |
radius of the corresponding (unconditional) contamination neighborhood. |
biastype |
BiasType: type of the bias |
normtype |
NormType: type of the norm |
modifyIC |
object of class |
Value
Object of class "TotalVarIC"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
IC1 <- TotalVarIC()
plot(IC1)
Influence curve of total variation type
Description
Class of (partial) influence curves of total variation type.
i.e., an influence curves \eta
of the form
\eta = c \vee A\Lambda \wedge d
with lower clipping bound c
, upper clipping bound d
and
standardizing matrix A
. \Lambda
stands for
the L2 derivative of the corresponding L2 differentiable
parametric family which can be created via CallL2Fam
.
Objects from the Class
Objects can be created by calls of the form new("TotalVarIC", ...)
.
More frequently they are created via the generating function
TotalVarIC
, respectively via the method generateIC
.
Slots
CallL2Fam
object of class
"call"
: creates an object of the underlying L2-differentiable parametric family.name
object of class
"character"
.Curve
object of class
"EuclRandVarList"
.modifyIC
object of class
"OptionalFunction"
: function of four arguments: (1)L2Fam
an L2 parametric family (2)IC
an optional influence curve, (3)withMakeIC
a logical argument whether to enforce the IC side conditions bymakeIC
, and (4)...
for arguments to be passed to calls toE
inmakeIC
. Returns an object of class"IC"
. This function is mainly used for internal computations!Risks
object of class
"list"
: list of risks; cf.RiskType-class
.Infos
object of class
"matrix"
with two columns namedmethod
andmessage
: additional informations.clipLo
object of class
"numeric"
: lower clipping bound.clipUp
object of class
"numeric"
: upper clipping bound.stand
object of class
"matrix"
: standardizing matrix.weight
object of class
"BdStWeight"
: weight functionbiastype
object of class
"BiasType"
: bias type (symmetric/onsided/asymmetric)normtype
object of class
"NormType"
: norm type (Euclidean, information/self-standardized)neighborRadius
object of class
"numeric"
: radius of the corresponding (unconditional) contamination neighborhood.
Extends
Class "HampIC"
, directly.
Class "IC"
, by class "HampIC"
.
Class "InfluenceCurve"
, by class "IC"
.
Methods
- CallL2Fam<-
signature(object = "TotalVarIC")
: replacement function for slotCallL2Fam
.- clipLo
signature(object = "TotalVarIC")
: accessor function for slotclipLo
.- clipLo<-
signature(object = "TotalVarIC")
: replacement function for slotclipLo
.- clipUp
signature(object = "TotalVarIC")
: accessor function for slotclipUp
.- clipUp<-
signature(object = "TotalVarIC")
: replacement function for slotclipUp
.- clip
signature(x1 = "TotalVarIC")
: returnsclipUp-clipLo
.- stand<-
signature(object = "TotalVarIC")
: replacement function for slotstand
.- lowerCase<-
signature(object = "TotalVarIC")
: replacement function for slotlowerCase
.- neighbor
signature(object = "TotalVarIC")
: generates an object of class"TotalVarNeighborhood"
with radius given in slotneighborRadius
.- generateIC
signature(neighbor = "TotalVarNeighborhood", L2Fam = "L2ParamFamily")
: generate an object of class"TotalVarIC"
. Rarely called directly.- show
signature(object = "TotalVarIC")
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
IC-class
, ContIC
, HampIC-class
Examples
IC1 <- new("TotalVarIC")
plot(IC1)
Generating function for TotalVarNeighborhood-class
Description
Generates an object of class "TotalVarNeighborhood"
.
Usage
TotalVarNeighborhood(radius = 0)
Arguments
radius |
non-negative real: neighborhood radius. |
Value
Object of class "ContNeighborhood"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
TotalVarNeighborhood()
## The function is currently defined as
function(radius = 0){
new("TotalVarNeighborhood", radius = radius)
}
Total variation neighborhood
Description
Class of (unconditional) total variation neighborhoods.
Objects from the Class
Objects can be created by calls of the form new("TotalVarNeighborhood", ...)
.
More frequently they are created via the generating function
TotalVarNeighborhood
.
Slots
type
Object of class
"character"
: “(uncond.) total variation neighborhood”.radius
Object of class
"numeric"
: neighborhood radius.
Extends
Class "UncondNeighborhood"
, directly.
Class "Neighborhood"
, by class "UncondNeighborhood"
.
Methods
No methods defined with class "TotalVarNeighborhood" in the signature.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
TotalVarNeighborhood
, UncondNeighborhood-class
Examples
new("TotalVarNeighborhood")
Unconditional neighborhood
Description
Class of unconditonal (errors-in-variables) neighborhoods.
Objects from the Class
A virtual Class: No objects may be created from it.
Slots
type
Object of class
"character"
: type of the neighborhood.radius
Object of class
"numeric"
: neighborhood radius.
Extends
Class "Neighborhood"
, directly.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Methods for Function biastype in Package ‘RobAStBase’
Description
biastype-methods
Methods
- biastype
signature(object = "interpolrisk")
: returns the slotbiastype
of an object of class"interpolrisk"
.
Examples
myrisk <- MBRRisk(samplesize=100)
biastype(myrisk)
Generic Function for Checking ICs
Description
Generic function for checking centering and Fisher consistency of ICs.
Usage
checkIC(IC, L2Fam, ...)
## S4 method for signature 'IC,missing'
checkIC(IC, out = TRUE, ..., diagnostic = FALSE)
## S4 method for signature 'IC,L2ParamFamily'
checkIC(IC, L2Fam, out = TRUE,..., diagnostic = FALSE)
Arguments
IC |
object of class |
L2Fam |
L2-differentiable family of probability measures. |
out |
logical: Should the values of the checks be printed out? |
... |
additional parameters |
diagnostic |
logical; if |
Details
The precisions of the centering and the Fisher consistency are computed.
Diagnostics on the involved integrations are available if argument
diagnostic
is TRUE
. Then there is attribute diagnostic
attached to the return value, which may be inspected
and accessed through showDiagnostic
and
getDiagnostic
.
Value
The maximum deviation from the IC properties is returned.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
IC1 <- new("IC")
checkIC(IC1)
Compare - Plots
Description
Plots 2-4 influence curves to the same model.
Usage
comparePlot(obj1, obj2, ... )
## S4 method for signature 'IC,IC'
comparePlot(obj1, obj2, obj3 = NULL, obj4 = NULL, data = NULL,
..., withSweave = getdistrOption("withSweave"),
forceSameModel = FALSE, main = FALSE, inner = TRUE,
sub = FALSE, col = par("col"), lwd = par("lwd"), lty,
col.inner = par("col.main"), cex.inner = 0.8,
bmar = par("mar")[1], tmar = par("mar")[3],
with.automatic.grid = TRUE, with.legend = FALSE,
legend = NULL, legend.bg = "white",
legend.location = "bottomright", legend.cex = 0.8,
withMBR = FALSE, MBRB = NA, MBR.fac = 2, col.MBR = par("col"),
lty.MBR = "dashed", lwd.MBR = 0.8, x.vec = NULL,
scaleX = FALSE, scaleX.fct, scaleX.inv, scaleY = FALSE,
scaleY.fct = pnorm, scaleY.inv = qnorm, scaleN = 9,
x.ticks = NULL, y.ticks = NULL, mfColRow = TRUE,
to.draw.arg = NULL,
cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"),
pch.pts = 19, cex.npts = 1, cex.npts.fun = NULL,
col.npts = par("col"), pch.npts = 20, jitter.fac = 1,
with.lab = FALSE, cex.lbs = 1, adj.lbs = c(0, 0),
col.lbs = col.pts, lab.pts = NULL, lab.font = NULL,
alpha.trsp = NA, which.lbs = NULL, which.Order = NULL,
which.nonlbs = NULL, attr.pre = FALSE, return.Order = FALSE,
withSubst = TRUE)
Arguments
obj1 |
object of class |
obj2 |
object of class |
obj3 |
optional: object of class |
obj4 |
optional: object of class |
data |
optional data argument — for plotting observations into the plot; |
withSweave |
logical: if |
forceSameModel |
logical; shall we check / enforce that the model
of the ICs |
main |
logical: is a main title to be used? or |
col |
color[s] of ICs in arguments |
lwd |
linewidth[s] of ICs in arguments |
lty |
line-type[s] of ICs in arguments |
inner |
logical: do panels have their own titles? or |
sub |
logical: is a sub-title to be used? or |
tmar |
top margin – useful for non-standard main title sizes |
bmar |
bottom margin – useful for non-standard sub title sizes |
cex.inner |
magnification to be used for inner titles relative
to the current setting of |
col.inner |
character or integer code; color for the inner title |
with.automatic.grid |
logical; should a grid be plotted alongside
with the ticks of the axes, automatically? If |
with.legend |
logical; shall a legend be plotted? |
legend |
either |
legend.location |
a valid argument |
legend.bg |
background color for the legend |
legend.cex |
magnification factor for the legend |
withMBR |
logical; shall horizontal lines with min and max of MBRE be plotted for comparison? |
MBRB |
matrix (or |
MBR.fac |
positive factor; scales the bounds given by argument |
col.MBR |
color for the MBR lines; as usual |
lty.MBR |
line type for the MBR lines; as usual |
lwd.MBR |
line width for the MBR lines; as usual |
x.vec |
a numeric vector of grid points to evaluate the influence curve;
by default, |
scaleX |
logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)? |
scaleY |
logical; shall Y-axis be rescaled (by default according to a probit scale)? |
scaleX.fct |
an isotone, vectorized function mapping the domain of the IC
to [0,1]; if |
scaleX.inv |
the inverse function to |
scaleY.fct |
an isotone, vectorized function mapping for each coordinate the
range of the respective coordinate of the IC
to [0,1]; defaulting to the cdf of |
scaleY.inv |
an isotone, vectorized function mapping for each coordinate
the range [0,1] into the range of the respective coordinate of the IC;
defaulting to the quantile function of |
scaleN |
integer; defaults to 9; on rescaled axes, number of x and y ticks if drawn automatically; |
x.ticks |
numeric; defaults to NULL; (then ticks are chosen automatically); if non-NULL, user-given x-ticks (on original scale); |
y.ticks |
numeric; defaults to NULL; (then ticks are chosen automatically); if non-NULL, user-given y-ticks (on original scale); can be a list with one (numeric or NULL) item per panel |
mfColRow |
shall default partition in panels be used — defaults to |
to.draw.arg |
Either |
withSubst |
logical; if |
col.pts |
color of the points of the |
pch.pts |
symbol of the points of the |
cex.pts |
size of the points of the |
cex.pts.fun |
rescaling function for the size of the points to be plotted;
either |
col.npts |
color of the non-labelled points of the |
pch.npts |
symbol of the non-labelled points of the |
cex.npts |
size of the non-labelled points of the |
cex.npts.fun |
rescaling function for the size of the non-labelled points
to be plotted; either |
lab.pts |
character or NULL; labels to be plotted to the observations;
can be a vector of length |
with.lab |
logical; shall labels be plotted to the observations?
(May be a vector of length |
cex.lbs |
size of the labels; can be vectorized to an array
of dim nlbs x |
col.lbs |
color of the labels; can be vectorized to a matrix
of dim nlbs x |
adj.lbs |
adjustment of the labels; can be vectorized to an array of
dim 2 x |
lab.font |
font to be used for labels (may be a vector of length
|
alpha.trsp |
alpha transparency to be added ex post to colors
|
jitter.fac |
jittering factor used in case of a |
attr.pre |
logical; do graphical attributes for plotted data refer
to indices prior ( |
which.lbs |
either an integer vector with the indices of the observations
to be plotted into graph or |
which.Order |
for each of the given ICs, we order the observations (descending)
according to the norm given by the corresponding |
which.nonlbs |
indices of the observations which should be plotted but
not labelled; either an integer vector with the indices of the observations
to be plotted into graph or |
return.Order |
logical; if |
... |
further arguments to be passed to |
Details
Any parameters of plot.default
may be passed on to this particular
plot
method.
For main-, inner, and subtitles given as arguments main
,
inner
, and sub
, top and bottom margins are enlarged to 5 resp.
6 by default but may also be specified by tmar
/ bmar
arguments.
If main
/ inner
/ sub
are
logical then if the respective argument is FALSE
nothing is done/plotted,
but if it is TRUE
, we use a default main title taking up the calling
arguments in case of main
, default inner titles taking up the
class and (named) parameter slots of arguments in case of inner
,
and a "generated on <data>"-tag in case of sub
.
Of course, if main
/ inner
/ sub
are character
, this
is used for the title; in case of inner
it is then checked whether it
has correct length. If argument withSubst
is TRUE
, in all title
and axis lable arguments, the following patterns are substituted:
"%C1"
,"%C2"
,["%C3"
,]["%C4"
]class of argument
obj<i>
, i=1,..4"%A1"
,"%A2"
,["%A3"
,]["%A4"
]deparsed argument
obj<i>
, i=1,..4"%D"
time/date-string when the plot was generated
If argument ...
contains argument ylim
, this may either be
as in plot.default
(i.e. a vector of length 2) or a vector of
length 2*(number of plotted dimensions); in the case of longer length,
these are the values for ylim
for the plotted dimensions of the IC,
one pair for each dimension.
In addition, argument ...
may contain arguments panel.first
,
panel.last
, i.e., hook expressions to be evaluated at the very beginning
and at the very end of each panel (within the then valid coordinates).
To be able to use these hooks for each panel individually, they may also be
lists of expressions (of the same length as the number of panels and
run through in the same order as the panels).
Value
An S3 object of class c("plotInfo","DiagnInfo")
, i.e., a list
containing the information needed to produce the
respective plot, which at a later stage could be used by different
graphic engines (like, e.g. ggplot
) to produce the plot
in a different framework. A more detailed description will follow in
a subsequent version.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
L2ParamFamily-class
,
IC-class
, plot
Examples
if(require(ROptEst)){
N0 <- NormLocationScaleFamily(mean=0, sd=1)
N0.Rob1 <- InfRobModel(center = N0, neighbor = ContNeighborhood(radius = 0.5))
IC1 <- optIC(model = N0, risk = asCov())
IC2 <- optIC(model = N0.Rob1, risk = asMSE())
comparePlot(IC1,IC2)
set.seed(12); data <- r(N0)(20)
comparePlot(IC1, IC2, data=data, with.lab = TRUE,
which.lbs = c(1:4,15:20),
which.Order = 1:6,
return.Order = TRUE)
## don't test to reduce check time on CRAN
## selection of subpanels for plotting
par(mfrow=c(1,1))
comparePlot(IC1, IC2 ,mfColRow = FALSE, to.draw.arg=c("mean"),
panel.first= grid(),ylim=c(-4,4),xlim=c(-6,6))
## matrix-valued ylim
comparePlot(IC1, IC2, panel.first= grid(),ylim=c(-4,4,0,4),xlim=c(-6,6))
x <- c(data,-12,10)
comparePlot(IC1, IC2, data=x, which.Order=10,
panel.first= grid(), ylim=c(-4,4,0,4), xlim=c(-6,6))
Y <- Chisq(df=1)* DiscreteDistribution(c(-1,1))
comparePlot(IC1, IC2, data=x, which.Order=10,
scaleX = TRUE, scaleX.fct=pnorm, scaleX.inv=qnorm,
scaleY = TRUE, scaleY.fct=p(Y), scaleY.inv=q.l(Y),
panel.first= grid(), ylim=c(-4,4,0,4), xlim=c(-6,6))
comparePlot(IC1, IC2, data=x, which.Order=10,
scaleX = TRUE, scaleX.fct=pnorm, scaleX.inv=qnorm,
scaleY = TRUE, scaleY.fct=p(Y), scaleY.inv=q.l(Y),
x.ticks = c(-Inf, -10, -1,0,1,10,Inf),
y.ticks = c(-Inf, -5, -1,0,1,5,Inf),
panel.first= grid(), ylim=c(-4,4,0,4), xlim=c(-6,6))
## with use of trafo-matrix:
G <- GammaFamily(scale = 1, shape = 2)
## explicitely transforming to
## MASS parametrization:
mtrafo <- function(x){
nms0 <- names(c(main(param(G)),nuisance(param(G))))
nms <- c("shape","rate")
fval0 <- c(x[2], 1/x[1])
names(fval0) <- nms
mat0 <- matrix( c(0, -1/x[1]^2, 1, 0), nrow = 2, ncol = 2,
dimnames = list(nms,nms0))
list(fval = fval0, mat = mat0)}
G2 <- G
trafo(G2) <- mtrafo
G2
G2.Rob1 <- InfRobModel(center = G2, neighbor = ContNeighborhood(radius = 0.5))
system.time(IC1 <- optIC(model = G2, risk = asCov()))
system.time(IC2 <- optIC(model = G2.Rob1, risk = asMSE()))
system.time(IC2.i <- optIC(model = G2.Rob1, risk = asMSE(normtype=InfoNorm())))
system.time(IC2.s <- optIC(model = G2.Rob1, risk = asMSE(normtype=SelfNorm())))
comparePlot(IC1,IC2, IC2.i, IC2.s)
}
Generating function(s) for class 'cutoff'
Description
Generating function(s) for class cutoff
.
Usage
cutoff(name = "empirical", body.fct0,
cutoff.quantile = 0.95,
norm = NormType(), QF, nsim = 100000)
cutoff.sememp(cutoff.quantile = 0.95)
cutoff.chisq(cutoff.quantile = 0.95)
cutoff.quant(qfct)
Arguments
name |
argument for name slot of |
body.fct0 |
a call generated by code wrapped to |
cutoff.quantile |
numeric (in [0,1]); the corresponding slot value for the |
norm |
an object of class |
nsim |
integer: the sample size used for determining the quantiles
of |
QF |
a quadratic (positive semidefinite, symmetric) matrix used as quadratic form |
qfct |
a (nominal) quantile function |
Details
cutoff
generates a valid object of class "cutoff"
.
As function slot fct
may only have a formal argument data
,
the other arguments to determine the cutoff value, i.e. norm
, QF
, nsim
,
cutoff.quantile
, nsim
have to enter the scope of this
function by lexical scoping; now cutoff.quantile
, norm
, QF
are to be taken from the calling environment (not from the defining one),
so we have delay evaluation of the function body, which is why we assume
it to be given wrapped into substitute
resp. quote
.
body.fct0
is by default (i.e. if argument body.fct0
is missing) set
to
quote(quantile(slot(norm,"fct")(data), cutoff.quantile))
, internally,
i.e.; to an empirical quantile of the corresponding norms.
cutoff.sememp()
is a helper function generating the theoretical (asymptotic)
quantile of (the square root of) a corresponding quadratic form, assuming multivariate
normality; to determine this quantile nsim
simulations are used.
cutoff.chisq()
is a helper function generating the theoretical (asymptotic)
quantile of (the square root of) a (self-standardized) quadratic form, assuming multivariate
normality; i.e.; a corresponding quantile of a Chi-Square distribution.
cutoff.quant()
is a helper function generating the theoretical quantile
corresponding to the quantile function qfct
; if qfct
is missing,
it searches the caller environment for an object ..ICloc
, and if this
exists it uses the respective model quantile function; the fallback is
qnorm
. At any rate, if there is an object ..trf
in the scope of
the function it is used to transfer the quantile (after its evaluation).
Value
Object of class "cutoff"
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
See Also
Examples
cutoff()
cutoff.sememp()
cutoff.chisq()
Cutoff class for distance-distance plots
Description
Class of methods to determine cutoff point for distance-distance plots; used to derive other cutoff methods later by method dispatch.
Objects from the Class
Objects could in principle be created by calls of the form new("cutoff", ...)
.
More frequently they are created via the generating function
cutoff
, respectively via the helper functions
cutoff.sememp
and cutoff.chisq
.
Slots
name
:object of class
"character"
; defaults to"empirical"
in prototype;fct
:an object of of class
"function"
; for this class layer, this function must only have one argumentdata
(which may but need not be used to determine the cutoff point empirically); in derived classes this restriction could be dropped, if corresponding special methods forddPlot
are derived. Defaults tofunction(data) quantile(data)
.cutoff.quantile
:Object of class
"numeric"
: a probability (in [0,1]) to determine the respective quantile (empirical or theoretical) to plot the cutoff line; defaults to0.95
in prototype;
Methods
- cutoff.quantile
signature(object = "cutoff")
: accessor function for slotcutoff.quantile
.- cutoff.quantile<-
signature(object = "cutoff")
: replacement function for slotcutoff.quantile
.- fct
signature(object = "cutoff")
: accessor function for slotfct
.- name
signature(object = "cutoff")
: accessor function for slotname
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
See Also
Examples
cutoff()
Methods for Function ddPlot in Package ‘RobAStBase’
Description
ddPlot-methods
Usage
ddPlot(data, dist.x, dist.y, cutoff.x, cutoff.y, ...)
## S4 method for signature 'matrix'
ddPlot(data, dist.x = NormType(), dist.y = NormType(),
cutoff.x, cutoff.y, ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
transform.x, transform.y = transform.x,
id.n, cex.pts = 1,lab.pts, jitter.pts = 0, alpha.trsp = NA, adj =0, cex.idn,
col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE,
text.abline.x = NULL, text.abline.y = NULL,
cex.abline = par("cex"), col.abline = col.cutoff,
font.abline = par("font"), adj.abline = c(0,0),
text.abline.x.x = NULL, text.abline.x.y = NULL,
text.abline.y.x = NULL, text.abline.y.y = NULL,
text.abline.x.fmt.cx = "%7.2f", text.abline.x.fmt.qx = "%4.2f%%",
text.abline.y.fmt.cy = "%7.2f", text.abline.y.fmt.qy = "%4.2f%%",
jitter.fac, jitter.tol = .Machine$double.eps,doplot = TRUE)
## S4 method for signature 'numeric'
ddPlot(data, dist.x = NormType(), dist.y = NormType(),
cutoff.x, cutoff.y, ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
transform.x, transform.y = transform.x,
id.n, cex.pts = 1,lab.pts, jitter.pts = 0, alpha.trsp = NA, adj =0, cex.idn,
col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE,
text.abline.x = NULL, text.abline.y = NULL,
cex.abline = par("cex"), col.abline = col.cutoff,
font.abline = par("font"), adj.abline = c(0,0),
text.abline.x.x = NULL, text.abline.x.y = NULL,
text.abline.y.x = NULL, text.abline.y.y = NULL,
text.abline.x.fmt.cx = "%7.2f", text.abline.x.fmt.qx = "%4.2f%%",
text.abline.y.fmt.cy = "%7.2f", text.abline.y.fmt.qy = "%4.2f%%",
jitter.fac, jitter.tol=.Machine$double.eps, doplot = TRUE)
## S4 method for signature 'data.frame'
ddPlot(data, dist.x = NormType(), dist.y = NormType(),
cutoff.x, cutoff.y, ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
transform.x, transform.y = transform.x,
id.n, cex.pts = 1,lab.pts, jitter.pts = 0, alpha.trsp = NA, adj =0, cex.idn,
col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE,
text.abline.x = NULL, text.abline.y = NULL,
cex.abline = par("cex"), col.abline = col.cutoff,
font.abline = par("font"), adj.abline = c(0,0),
text.abline.x.x = NULL, text.abline.x.y = NULL,
text.abline.y.x = NULL, text.abline.y.y = NULL,
text.abline.x.fmt.cx = "%7.2f", text.abline.x.fmt.qx = "%4.2f%%",
text.abline.y.fmt.cy = "%7.2f", text.abline.y.fmt.qy = "%4.2f%%",
jitter.fac, jitter.tol=.Machine$double.eps, doplot = TRUE)
Arguments
data |
data coercable to |
... |
further arguments to be passed to |
dist.x |
object of class |
dist.y |
object of class |
cutoff.x |
object of class |
cutoff.y |
object of class |
cutoff.quantile.x |
numeric; the cutoff quantile for the |
cutoff.quantile.y |
numeric; the cutoff quantile for the |
transform.x |
function; a transformation to be performed before determining the
distances of the |
transform.y |
function; a transformation to be performed before determining the
distances of the |
id.n |
a set of indices (or a corresponding logical vector); to select a subset
of the data in argument |
cex.pts |
the corresponding |
lab.pts |
a vector of labels for the (unsubsetted) |
jitter.pts |
the corresponding |
alpha.trsp |
alpha transparency to be added ex post to colors
|
adj |
the corresponding argument for |
cex.idn |
the corresponding |
col.idn |
the corresponding |
lty.cutoff |
the corresponding |
lwd.cutoff |
(vector cast to length 2): the corresponding |
col.cutoff |
(vector cast to length 2): the corresponding |
text.abline |
vector of logicals (cast to length 2): shall text be added to cutoff lines. |
text.abline.x |
text to be added to cutoff lines in x direction; if |
text.abline.y |
text to be added to cutoff lines in y direction; if |
cex.abline |
vector of numerics (cast to length 2): cex-value for added cutoff text. |
col.abline |
vector of length 2: color for added cutoff text. |
font.abline |
vector of length 2: font for added cutoff text. |
adj.abline |
cast to 2 x 2 matrix (by recycling rules): adjustment values for added cutoff text. |
text.abline.x.y |
y-coordinate of text to be added to cutoff lines in x direction;
if |
text.abline.y.x |
x-coordinate of text to be added to cutoff lines in y direction;
if |
text.abline.x.x |
x-coordinate of text to be added to cutoff lines in x direction;
if |
text.abline.y.y |
y-coordinate of text to be added to cutoff lines in y direction;
if |
text.abline.x.fmt.cx |
format string (see |
text.abline.x.fmt.qx |
format string to format cutoff probability in label in x direction. |
text.abline.y.fmt.cy |
format string to format the cutoff value in label in y direction. |
text.abline.y.fmt.qy |
format string to format cutoff probability in label in y direction. |
jitter.fac |
factor for jittering, see |
jitter.tol |
threshold for jittering: if distance between points is smaller
than |
doplot |
logical; shall a plot be produced? if |
Details
The matrix
-method calls .ddPlot.MatNtNtCoCo
,
the numeric
- and data.frame
-methods coerce argument data
to matrix
— the numeric
-method by a call to matrix(data, nrow=1)
,
in the data.frame
-methods by a call to t(as.matrix(data))
.
In arguments text.abline.x
and text.abline.y
the following
patterns are substituted:
"%qx"
cutoff-quantile in x-direction
"%qy"
cutoff-quantile in y-direction
"%cx"
cutoff-value in x-direction
"%cy"
cutoff-value in y-direction
Value
If argument doplot
is FALSE
:
A list (returned as invisible()
) with items
id.x |
the indices of (possibly transformed) data (within subset |
id.y |
the indices of (possibly transformed) data (within subset |
id.xy |
the indices of (possibly transformed) data (within subset |
qtx |
the quantiles of the distances of the (possibly transformed) data in |
qty |
the quantiles of the distances of the (possibly transformed) data in |
cutoff.x.v |
the cutoff value in |
cutoff.y.v |
the cutoff value in |
If argument doplot
is TRUE
:
An S3 object of class c("plotInfo","DiagnInfo")
, i.e., a list
containing the information needed to produce the
respective plot, which at a later stage could be used by different
graphic engines (like, e.g. ggplot
) to produce the plot
in a different framework. A more detailed description will follow in
a subsequent version.
One item is retV
which is the return value in case doplot
is FALSE
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
Examples
MX <- matrix(rnorm(1500),nrow=6)
QM <- matrix(rnorm(36),nrow=6); QM <- QM %*% t(QM)
ddPlot(data=MX, dist.y=QFNorm(QuadF=PosSemDefSymmMatrix(QM)))
Generic function for evaluating ICs
Description
Generic function for evaluating ICs.
Usage
evalIC(IC, x)
Arguments
IC |
object of class |
x |
numeric vector or matrix |
Details
The list of random variables contained in the slot Curve
is evaluated at x
.
Value
In case x
is numeric a vector and in case x
is matrix a matrix is returned.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Generic function for the generation of influence curves
Description
This function is rarely called directly. It is used
by other functions to create objects of class "IC"
.
Usage
generateIC(neighbor, L2Fam, ...)
Arguments
neighbor |
Object of class |
L2Fam |
L2-differentiable family of probability measures. |
... |
additional parameters |
Value
Object of class "IC"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
IC-class
, ContIC-class
, TotalVarIC-class
Generic Function for making ICs consistent at a possibly different model
Description
Generic function for providing centering and Fisher consistency of ICs.
Usage
generateIC.fct(neighbor, L2Fam, ...)
Arguments
neighbor |
object of class |
L2Fam |
L2-differentiable family of probability measures; may be missing. |
... |
additional parameters |
Value
An IC at the model.
Methods
- generateIC.fct
signature(IC = "UncondNeighborhood", L2Fam = "L2ParamFamily"
: ...
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Generic function for the computation of the asymptotic bias for an IC
Description
Generic function for the computation of the asymptotic bias for an IC.
Usage
getBiasIC(IC, neighbor, ...)
## S4 method for signature 'IC,UncondNeighborhood'
getBiasIC(IC, neighbor, L2Fam,
biastype = symmetricBias(), normtype = NormType(),
tol = .Machine$double.eps^0.25, numbeval = 1e5, withCheck = TRUE, ...)
Arguments
IC |
object of class |
neighbor |
object of class |
L2Fam |
object of class |
biastype |
object of class |
normtype |
object of class |
tol |
the desired accuracy (convergence tolerance). |
numbeval |
number of evalation points. |
withCheck |
logical: should a call to |
... |
additional parameters to be passed to expectation |
Value
The bias of the IC is computed.
Methods
- IC = "IC", neighbor = "UncondNeighborhood"
-
determines the as. bias by random evaluation of the IC; this random evaluation is done by the internal S4-method
.evalBiasIC
; this latter dispatches according to the signatureIC, neighbor, biastype
.
For signatureIC="IC", neighbor = "ContNeighborhood", biastype = "BiasType"
, also an argumentnormtype
is used to be able to use self- or information standardizing norms; besides this the signaturesIC="IC", neighbor = "TotalVarNeighborhood", biastype = "BiasType"
,IC="IC", neighbor = "ContNeighborhood", biastype = "onesidedBias"
, andIC="IC", neighbor = "ContNeighborhood", biastype = "asymmetricBias"
are implemented.
Note
This generic function is still under construction.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Huber, P.J. (1968) Robust Confidence Limits. Z. Wahrscheinlichkeitstheor. Verw. Geb. 10:269–278.
Rieder, H. (1980) Estimates derived from robust tests. Ann. Stats. 8: 106–115.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
Ruckdeschel, P. and Kohl, M. (2005) Computation of the Finite Sample Bias of M-estimators on Neighborhoods.
See Also
getRiskIC-methods
, InfRobModel-class
getBoundedIC
Description
Generates a bounded influence curve.
Usage
getBoundedIC(L2Fam, D=trafo(L2Fam@param), ..., diagnostic = FALSE)
Arguments
L2Fam |
object of class |
D |
matrix with as many columns as |
... |
further arguments to be passed to |
diagnostic |
logical; if |
Value
(a bounded) pIC (to matrix D
) given as object of class
"EuclRandVariable"
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Generic Function for Computation of Finite-Sample Risks
Description
Generic function for the computation of finite-sample risks. This function is rarely called directly. It is used by other functions.
Usage
getFiRisk(risk, Distr, neighbor, ...)
## S4 method for signature 'fiUnOvShoot,Norm,ContNeighborhood'
getFiRisk(risk, Distr,
neighbor, clip, stand, sampleSize, Algo, cont)
## S4 method for signature 'fiUnOvShoot,Norm,TotalVarNeighborhood'
getFiRisk(risk, Distr,
neighbor, clip, stand, sampleSize, Algo, cont)
Arguments
risk |
object of class |
Distr |
object of class |
neighbor |
object of class |
... |
additional parameters. |
clip |
positive real: clipping bound |
stand |
standardizing constant/matrix. |
sampleSize |
integer: sample size. |
Algo |
"A" or "B". |
cont |
"left" or "right". |
Details
The computation of the finite-sample under-/overshoot risk is based on FFT. For more details we refer to Section 11.3 of Kohl (2005).
Value
The finite-sample risk is computed.
Methods
- risk = "fiUnOvShoot", Distr = "Norm", neighbor = "ContNeighborhood"
-
computes finite-sample under-/overshoot risk in methods for function
getFixRobIC
. - risk = "fiUnOvShoot", Distr = "Norm", neighbor = "TotalVarNeighborhood"
-
computes finite-sample under-/overshoot risk in methods for function
getFixRobIC
.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Huber, P.J. (1968) Robust Confidence Limits. Z. Wahrscheinlichkeitstheor. Verw. Geb. 10:269–278.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
Ruckdeschel, P. and Kohl, M. (2005) Computation of the Finite Sample Risk of M-estimators on Neighborhoods.
See Also
Methods for Function getRiskFctBV in Package ‘RobAStBase’
Description
getRiskFctBV for a given object of S4 class asGRisk
returns a function in bias and variance to compute the asymptotic
risk.
Methods
- getRiskFctBV
signature(risk = "asGRisk", biastype = "ANY")
: returns an error that the respective method is not yet implemented.- getRiskFctBV
signature(risk = "asMSE", biastype = "ANY")
: returns a function with argumentsbias
andvariance
to compute the asymptotic MSE for a given ALE at a situation where it has biasbias
(including the radius!) and variancevariance
.- getRiskFctBV
signature(risk = "asSemivar", biastype = "onesidedBias")
: returns a function with argumentsbias
andvariance
to compute the asymptotic semivariance error, i.e.E[(S_n-\theta)_+^2]
resp.E[(S_n-\theta)_-^2]
, for a given ALES_n
at a situation where it has one-sided biasbias
(including the radius!) and variancevariance
.- getRiskFctBV
signature(risk = "asSemivar", biastype = "asymmetricBias")
: returns a function with argumentsbias
andvariance
to compute the asymptotic semivariance error, i.e.E[\nu_1 (S_n-\theta)_+^2+\nu_2(S_n-\theta)_-^2]
for a given ALES_n
at a situation where it has one-sided biasbias
(including the radius!) and variancevariance
.
Examples
myrisk <- asMSE()
getRiskFctBV(myrisk)
Generic function for the computation of a risk for an IC
Description
Generic function for the computation of a risk for an IC.
Usage
getRiskIC(IC, risk, neighbor, L2Fam, ...)
## S4 method for signature 'IC,asCov,missing,missing'
getRiskIC(IC, risk,
tol = .Machine$double.eps^0.25, withCheck = TRUE, ...)
## S4 method for signature 'IC,asCov,missing,L2ParamFamily'
getRiskIC(IC, risk, L2Fam,
tol = .Machine$double.eps^0.25, withCheck = TRUE, ..., diagnostic = FALSE)
## S4 method for signature 'IC,trAsCov,missing,missing'
getRiskIC(IC, risk,
tol = .Machine$double.eps^0.25, withCheck = TRUE, ...)
## S4 method for signature 'IC,trAsCov,missing,L2ParamFamily'
getRiskIC(IC, risk, L2Fam,
tol = .Machine$double.eps^0.25, withCheck = TRUE, ...)
## S4 method for signature 'IC,asBias,UncondNeighborhood,missing'
getRiskIC(IC, risk, neighbor,
tol = .Machine$double.eps^0.25, withCheck = TRUE, ...)
## S4 method for signature 'IC,asBias,UncondNeighborhood,L2ParamFamily'
getRiskIC(IC, risk, neighbor, L2Fam,
tol = .Machine$double.eps^0.25, withCheck = TRUE, ...)
## S4 method for signature 'IC,asMSE,UncondNeighborhood,missing'
getRiskIC(IC, risk, neighbor,
tol = .Machine$double.eps^0.25, withCheck = TRUE, ...)
## S4 method for signature 'IC,asMSE,UncondNeighborhood,L2ParamFamily'
getRiskIC(IC, risk, neighbor, L2Fam,
tol = .Machine$double.eps^0.25, withCheck = TRUE, ...)
## S4 method for signature 'TotalVarIC,asUnOvShoot,UncondNeighborhood,missing'
getRiskIC(IC, risk, neighbor)
## S4 method for signature 'IC,fiUnOvShoot,ContNeighborhood,missing'
getRiskIC(IC, risk, neighbor, sampleSize, Algo = "A", cont = "left")
## S4 method for signature 'IC,fiUnOvShoot,TotalVarNeighborhood,missing'
getRiskIC(IC, risk, neighbor, sampleSize, Algo = "A", cont = "left")
Arguments
IC |
object of class |
risk |
object of class |
neighbor |
object of class |
L2Fam |
object of class |
... |
additional parameters (e.g. to be passed to |
tol |
the desired accuracy (convergence tolerance). |
sampleSize |
integer: sample size. |
Algo |
"A" or "B". |
cont |
"left" or "right". |
withCheck |
logical: should a call to |
diagnostic |
logical; if |
Details
To make sure that the results are valid, it is recommended
to include an additional check of the IC properties of IC
using checkIC
.
Value
The risk of an IC is computed.
Methods
- IC = "IC", risk = "asCov", neighbor = "missing", L2Fam = "missing"
-
asymptotic covariance of
IC
. - IC = "IC", risk = "asCov", neighbor = "missing", L2Fam = "L2ParamFamily"
-
asymptotic covariance of
IC
underL2Fam
. - IC = "IC", risk = "trAsCov", neighbor = "missing", L2Fam = "missing"
-
asymptotic covariance of
IC
. - IC = "IC", risk = "trAsCov", neighbor = "missing", L2Fam = "L2ParamFamily"
-
asymptotic covariance of
IC
underL2Fam
. - IC = "IC", risk = "asBias", neighbor = "ContNeighborhood", L2Fam = "missing"
-
asymptotic bias of
IC
under convex contaminations; uses methodgetBiasIC
. - IC = "IC", risk = "asBias", neighbor = "ContNeighborhood", L2Fam = "L2ParamFamily"
-
asymptotic bias of
IC
under convex contaminations andL2Fam
; uses methodgetBiasIC
. - IC = "IC", risk = "asBias", neighbor = "TotalVarNeighborhood", L2Fam = "missing"
-
asymptotic bias of
IC
in case of total variation neighborhoods; uses methodgetBiasIC
. - IC = "IC", risk = "asBias", neighbor = "TotalVarNeighborhood", L2Fam = "L2ParamFamily"
-
asymptotic bias of
IC
underL2Fam
in case of total variation neighborhoods; uses methodgetBiasIC
. - IC = "IC", risk = "asMSE", neighbor = "UncondNeighborhood", L2Fam = "missing"
-
asymptotic mean square error of
IC
. - IC = "IC", risk = "asMSE", neighbor = "UncondNeighborhood", L2Fam = "L2ParamFamily"
-
asymptotic mean square error of
IC
underL2Fam
. - IC = "TotalVarIC", risk = "asUnOvShoot", neighbor = "UncondNeighborhood", L2Fam = "missing"
-
asymptotic under-/overshoot risk of
IC
. - IC = "IC", risk = "fiUnOvShoot", neighbor = "ContNeighborhood", L2Fam = "missing"
-
finite-sample under-/overshoot risk of
IC
. - IC = "IC", risk = "fiUnOvShoot", neighbor = "TotalVarNeighborhood", L2Fam = "missing"
-
finite-sample under-/overshoot risk of
IC
.
Note
This generic function is still under construction.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Huber, P.J. (1968) Robust Confidence Limits. Z. Wahrscheinlichkeitstheor. Verw. Geb. 10:269–278.
Rieder, H. (1980) Estimates derived from robust tests. Ann. Stats. 8: 106–115.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
Ruckdeschel, P. and Kohl, M. (2005) Computation of the Finite Sample Risk of M-estimators on Neighborhoods.
See Also
Generating weights
Description
Generates weight functions of Hampel / BdSt type for different bias and norm types.
Usage
getweight(Weight, neighbor, biastype, ...)
minbiasweight(Weight, neighbor, biastype, ...)
## S4 method for signature 'HampelWeight,ContNeighborhood,BiasType'
getweight(Weight, neighbor, biastype, normW)
## S4 method for signature 'HampelWeight,ContNeighborhood,BiasType'
minbiasweight(Weight, neighbor, biastype, normW)
## S4 method for signature 'HampelWeight,ContNeighborhood,onesidedBias'
getweight(Weight, neighbor, biastype, ...)
## S4 method for signature 'HampelWeight,ContNeighborhood,onesidedBias'
minbiasweight(Weight, neighbor, biastype, ...)
## S4 method for signature 'HampelWeight,ContNeighborhood,asymmetricBias'
getweight(Weight, neighbor, biastype, ...)
## S4 method for signature 'HampelWeight,ContNeighborhood,asymmetricBias'
minbiasweight(Weight, neighbor, biastype, ...)
## S4 method for signature 'BdStWeight,TotalVarNeighborhood,BiasType'
getweight(Weight, neighbor, biastype, ...)
## S4 method for signature 'BdStWeight,TotalVarNeighborhood,BiasType'
minbiasweight(Weight, neighbor, biastype, ...)
Arguments
Weight |
Object of class |
neighbor |
Object of class |
biastype |
Object of class |
normW |
Object of class |
... |
possibly additional (unused) arguments — like in a call to the less specific methods. |
Details
These functions generate the weight function in slot weight
in a corresp.
object of class RobWeight
and descendants.
Value
Object of class "HampelWeight"
resp. "BdStWeight"
Methods
- getweight
signature(Weight = "HampelWeight", neighbor = "ContNeighborhood", biastype = "BiasType")
with additional argumentbiastype
of class"BiasType"
: produces weight slot...- minbiasweight
signature(Weight = "HampelWeight", neighbor = "ContNeighborhood", biastype = "BiasType")
with additional argumentbiastype
of class"BiasType"
: produces weight slot...- getweight
signature(Weight = "HampelWeight", neighbor = "ContNeighborhood", biastype = "onesidedBias")
: produces weight slot...- minbiasweight
signature(Weight = "HampelWeight", neighbor = "ContNeighborhood", biastype = "onesidedBias")
: produces weight slot...- getweight
signature(Weight = "HampelWeight", neighbor = "ContNeighborhood", biastype = "asymmetricBias")
: produces weight slot...- minbiasweight
signature(Weight = "HampelWeight", neighbor = "ContNeighborhood", biastype = "asymmetricBias")
: produces weight slot...- getweight
signature(Weight = "BdStWeight", neighbor = "TotalVarNeighborhood", biastype = "BiasType")
: produces weight slot...- minbiasweight
signature(Weight = "BdStWeight", neighbor = "TotalVarNeighborhood", biastype = "BiasType")
: produces weight slot...
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Hampel et al. (1986) Robust Statistics. The Approach Based on Influence Functions. New York: Wiley.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
BdStWeight-class
,
HampelWeight-class
,
IC-class
Plot absolute and relative information
Description
Plot absolute and relative information of influence curves.
Usage
infoPlot(object, ...)
## S4 method for signature 'IC'
infoPlot(object, data = NULL,
..., withSweave = getdistrOption("withSweave"),
col = par("col"), lwd = par("lwd"), lty,
colI = grey(0.5), lwdI = 0.7*par("lwd"), ltyI = "dotted",
main = FALSE, inner = TRUE, sub = FALSE,
col.inner = par("col.main"), cex.inner = 0.8,
bmar = par("mar")[1], tmar = par("mar")[3],
with.automatic.grid = TRUE,
with.legend = TRUE, legend = NULL, legend.bg = "white",
legend.location = "bottomright", legend.cex = 0.8,
x.vec = NULL, scaleX = FALSE, scaleX.fct, scaleX.inv,
scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
scaleN = 9, x.ticks = NULL, y.ticks = NULL,
mfColRow = TRUE, to.draw.arg = NULL,
cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"),
pch.pts = 19,
cex.npts = 1, cex.npts.fun = NULL, col.npts = grey(.5),
pch.npts = 20,
jitter.fac = 1, with.lab = FALSE, cex.lbs = 1, adj.lbs = c(0, 0),
col.lbs = col.pts, lab.pts = NULL, lab.font = NULL, alpha.trsp = NA,
which.lbs = NULL, which.Order = NULL, which.nonlbs = NULL,
attr.pre = FALSE, return.Order = FALSE,
ylab.abs = "absolute information",
ylab.rel= "relative information",
withSubst = TRUE)
Arguments
object |
object of class |
data |
optional data argument — for plotting observations into the plot; |
withSweave |
logical: if |
main |
logical: is a main title to be used? or |
inner |
logical: do panels have their own titles? or |
sub |
logical: is a sub-title to be used? or |
tmar |
top margin – useful for non-standard main title sizes; may be a vector with individual values for each of the panels to be plotted. |
bmar |
bottom margin – useful for non-standard sub title sizes; may be a vector with individual values for each of the panels to be plotted. |
col |
color of IC in argument |
lwd |
linewidth of IC in argument |
lty |
line-type of IC in argument |
colI |
color of the classically optimal IC. |
lwdI |
linewidth of the classically optimal IC. |
ltyI |
line-type of the classically optimal IC. |
cex.inner |
magnification to be used for inner titles relative
to the current setting of |
col.inner |
character or integer code; color for the inner title |
with.automatic.grid |
logical; should a grid be plotted alongside
with the ticks of the axes, automatically? If |
with.legend |
logical; shall a legend be plotted? |
legend |
either |
legend.location |
a valid argument |
legend.bg |
background color for the legend |
legend.cex |
magnification factor for the legend |
x.vec |
a numeric vector of grid points to evaluate the influence curve;
by default, |
scaleX |
logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)? |
scaleY |
logical; shall Y-axis be rescaled for abs.info-plot (by default according to a probit scale)? |
scaleX.fct |
an isotone, vectorized function mapping the domain of the IC
to [0,1]; if |
scaleX.inv |
the inverse function to |
scaleY.fct |
an isotone, vectorized function mapping the
range of the norm of the IC to [0,1]; defaulting
to the cdf of |
scaleY.inv |
an isotone, vectorized function mapping [0,1] into the range
of the norm of the IC; defaulting to the quantile function
of |
scaleN |
integer; defaults to 9; on rescaled axes, number of x and y ticks if drawn automatically; |
x.ticks |
numeric; defaults to NULL; (then ticks are chosen automatically); if non-NULL, user-given x-ticks (on original scale); |
y.ticks |
numeric; defaults to NULL; (then ticks are chosen automatically); if non-NULL, user-given y-ticks (on original scale); can be a list with one (numeric or NULL) item per panel |
mfColRow |
shall default partition in panels be used — defaults to |
to.draw.arg |
Either |
withSubst |
logical; if |
col.pts |
color of the points of the |
pch.pts |
symbol of the points of the |
cex.pts |
size of the points of the |
cex.pts.fun |
rescaling function for the size of the points to be plotted;
either |
col.npts |
color of the non-labelled points of the |
pch.npts |
symbol of the non-labelled points of the |
cex.npts |
size of the non-labelled points of the |
cex.npts.fun |
rescaling function for the size of the non-labelled points
to be plotted; either |
attr.pre |
logical; do graphical attributes for plotted data refer
to indices prior ( |
with.lab |
logical; shall labels be plotted to the observations?
(may be a vector of length 2, see |
cex.lbs |
size of the labels; can be vectorized to an array
of dim nlbs x 2 x npnl where npnl is the number of plotted
panels and nlbs the number of plotted labels; if it is
a vector, it is recylced in order labels then ICs
[arg |
col.lbs |
color of the labels; can be vectorized to a matrix
of dim nlbs x 2 as |
adj.lbs |
adjustment of the labels; can be vectorized to an array
of dim 2 x 2 x npnl matrix, npnl the number of plotted panels;
if it is a vector, it is recycled in order (x,y)-coords then ICs
[arg |
lab.pts |
character or NULL; labels to be plotted to the observations;
can be a vector of length |
lab.font |
font to be used for labels; (may be a vector of length 2,
see |
alpha.trsp |
alpha transparency to be added ex post to colors
|
jitter.fac |
jittering factor used in case of a |
which.lbs |
either an integer vector with the indices of the observations
to be plotted into graph or |
which.Order |
we order the observations (descending) according to the norm given by
|
which.nonlbs |
indices of the observations which should be plotted but
not labelled; either an integer vector with the indices of the observations
to be plotted into graph or |
return.Order |
logical; if |
ylab.abs |
character; label to be used for y-axis in absolute information panel |
ylab.rel |
character; label to be used for y-axis in relative information panel |
... |
further parameters for |
Details
Absolute information is defined as the square of the length
of an IC. The relative information is defined as the
absolute information of one component with respect to the
absolute information of the whole IC; confer Section 8.1
of Kohl (2005).
Any parameters of plot.default
may be passed on to this particular
plot
method.
For main-, inner, and subtitles given as arguments main
,
inner
, and sub
, top and bottom margins are enlarged to 5 resp.
6 by default but may also be specified by tmar
/ bmar
arguments.
If main
/ inner
/ sub
are
logical then if the respective argument is FALSE
nothing is done/plotted,
but if it is TRUE
, we use a default main title taking up the calling
arguments in case of main
, default inner titles taking up the
class and (named) parameter slots of arguments in case of inner
,
and a "generated on <data>"-tag in case of sub
.
Of course, if main
/ inner
/ sub
are character
, this
is used for the title; in case of inner
it is then checked whether it
has correct length. If argument withSubst
is TRUE
, in all title
and axis lable arguments, the following patterns are substituted:
"%C"
class of argument
object
"%A"
deparsed argument
object
"%D"
time/date-string when the plot was generated
If argument ...
contains argument ylim
, this may either be
as in plot.default
(i.e. a vector of length 2) or a vector of
length 2*(number of plotted dimensions + e), where e is 1 or 0 depending
on whether absolute information is plotted or not;
in the case of longer length,
if e is 1, the first two elements are the values for ylim
in panel "Abs", while the last 2*(number of plotted dimensions)
are the values for ylim
for the plotted dimensions of the IC,
one pair for each dimension.
Similarly, if argument ...
contains arguments xaxt
or
yaxt
, these may be vectorized, with one value for each of the panels
to be plotted. This is useful for stacking panels over each other, using
a common x-axis (see example below).
The ...
argument may also contain an argument withbox
which
if TRUE
warrants that even if xaxt
and yaxt
both are
FALSE
, a box is drawn around the respective panel.
In addition, argument ...
may contain arguments panel.first
,
panel.last
, i.e., hook expressions to be evaluated at the very beginning
and at the very end of each panel (within the then valid coordinates).
To be able to use these hooks for each panel individually, they may also be
lists of expressions (of the same length as the number of panels and
run through in the same order as the panels).
Value
An S3 object of class c("plotInfo","DiagnInfo")
, i.e., a list
containing the information needed to produce the
respective plot, which at a later stage could be used by different
graphic engines (like, e.g. ggplot
) to produce the plot
in a different framework. A more detailed description will follow in
a subsequent version.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
N <- NormLocationScaleFamily(mean=0, sd=1)
IC1 <- optIC(model = N, risk = asCov())
infoPlot(IC1)
## don't run to reduce check time on CRAN
## selection of subpanels for plotting
par(mfrow=c(1,2))
infoPlot(IC1, mfColRow = FALSE, to.draw.arg=c("Abs","sd"))
infoPlot(IC1, mfColRow = FALSE, to.draw.arg=c("Abs","sd"), log="y")
infoPlot(IC1, mfColRow = FALSE, to.draw.arg=c("Abs","mean"),
panel.first= grid(), ylim = c(0,4), xlim = c(-6,6))
infoPlot(IC1, mfColRow = FALSE, to.draw.arg=c("Abs","mean"),
panel.first= grid(), ylim = c(0,4,-3,3), xlim = c(-6,6))
par(mfrow=c(1,3))
infoPlot(IC1, mfColRow = FALSE, panel.first= grid(),
ylim = c(0,4,0,.3,0,.8), xlim=c(-6,6))
par(mfrow=c(1,1))
data <- r(N)(20)
par(mfrow=c(1,3))
infoPlot(IC1, data=data, mfColRow = FALSE, panel.first= grid(),
with.lab = TRUE, cex.pts=2,
which.lbs = c(1:4,15:20), which.Order = 1:6,
return.Order = TRUE)
infoPlot(IC1, data=data[1:10], mfColRow = FALSE, panel.first= grid(),
with.lab = TRUE, cex.pts=0.7)
par(mfrow=c(1,1))
ICr <- makeIC(list(function(x)sign(x),function(x)sign(abs(x)-qnorm(.75))),N)
data <- r(N)(600)
data.c <- c(data, 1000*data[1:30])
par(mfrow=c(3,1))
infoPlot(ICr, data=data.c, tmar=c(4.1,0,0), bmar=c(0,0,4.1),
xaxt=c("n","n","s"), mfColRow = FALSE, panel.first= grid(),
cex.pts=c(.9,.9), alpha.trsp=20, lwd=2, lwdI=1.5, col=3,
col.pts=c(3,2), colI=2, pch.pts=c(20,20), inner=FALSE,
scaleX = TRUE, scaleX.fct=pnorm, scaleX.inv=qnorm,
scaleY=TRUE, scaleY.fct=function(x) pchisq(x,df=1),
scaleY.inv=function(x)qchisq(x,df=1),legend.cex = 1.0)
Internal / Helper functions of package RobAStBase for grids in plot functions
Description
These functions are internally used helper functions for plot
,
infoPlot
comparePlot
in package RobAStBase.
Usage
.getDimsTD(L2Fam,to.draw.arg)
.producePanelFirstS(panelFirst,IC,to.draw.arg, isInfoPlot=FALSE,
x.ticks, scaleX, scaleX.fct,
y.ticks, scaleY, scaleY.fct)
.producePanelFirstSn(panelFirst, x.ticks, scaleX, scaleX.fct,
y.ticks, scaleY, scaleY.fct, logArg)
Arguments
L2Fam |
the model at which the plot is produced (of class |
panelFirst |
argument |
x.ticks |
numeric: coordinates in original scale of user-given ticks on x-axis. |
scaleX |
logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)? |
scaleX.fct |
an isotone, vectorized function mapping the domain of the IC
to [0,1]; if |
y.ticks |
numeric: coordinates in original scale of user-given ticks on y-axis. |
scaleY |
logical; shall Y-axis be rescaled (by default according to a probit scale)? |
scaleY.fct |
an isotone, vectorized function mapping for each coordinate the
range of the respective coordinate of the IC
to [0,1]; defaulting to the cdf of |
to.draw.arg |
Either |
IC |
object of class |
isInfoPlot |
logical; is this function to be used in |
logArg |
a character with |
Details
.getDimsTD
computes the number of panels to be plotted.
.producePanelFirstS
produces an unevaluated expression to be
used as argument panel.first
in the diagnostic plots; i.e.;
knowing the actual tickmarks of the axis at the time of evaluation,
code is inserted to plot horizontal and vertical grid lines through
these tickmarks.
Internal / Helper functions of package RobAStBase
Description
These functions are used internally by package RobAStBase.
Usage
.eq(x,y = 0*x, tol = 1e-7)
.getDistr(L2Fam)
.evalListRec(list0)
.msapply(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)
.fixInLiesInSupport(IC, distr)
.filterEargsWEargList(dots)
Arguments
x |
a (numeric) vector |
y |
a (numeric) vector |
tol |
numeric — tolerance |
L2Fam |
object of class |
list0 |
a list |
X |
like |
FUN |
like |
... |
like |
simplify |
like |
USE.NAMES |
like |
IC |
an object of class |
distr |
a distribution |
dots |
a list, obtained by |
Details
.eq
checks equality of two vectors up to a given precision;
.getDistr
produces a string with the class of the family and its parameter value;
.evalListRec
recursively goes through the entries of a list, evaluating
each entry.
.msapply
like base::.sapply
but catches NULL
/zero-length arguments X
.
.fixInLiesInSupport
inserts a check into the function(s) in the Map
slot of
the influence curve (IC), whether the arguments at which the IC is to be evaluated lie
in the support of the distribution and accordingly either returns the function value
of the IC, or 0
; the check is done via calling liesInSupport
.
.filterEargsWEargList
calls distrEx::.filterEargs
to filter out of dots
all relevant arguments for the integrators, integrate
, GLIntegrate
,
and distrExIntegrate
; in addition, .filterEargsWEargList
checks if an argument "E.argList" is hidden in the dots
argument
and if so, filters in its entries; in case of collisions with entries filtered
from distrEx::.filterEargs
, it overwrites existing entries. In the
end it returns a list with the filtered items.
Value
.eq |
(a vector of) |
.getDistr |
|
.evalListRec |
a list. |
.msapply |
as |
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
Internal / Helper functions of package RobAStBase for ddPlot
Description
This function is an internally used helper function for ddPlot
in package RobAStBase.
Usage
.ddPlot.MatNtNtCoCo(data, ..., dist.x = NormType(), dist.y = NormType(),
cutoff.x = cutoff(norm = dist.x, cutoff.quantile = cutoff.quantile.x),
cutoff.y = cutoff(norm = dist.y, cutoff.quantile = cutoff.quantile.y),
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
transform.x,transform.y = transform.x, id.n, cex.pts = 1, lab.pts,
jitter.pts = 0, alpha.trsp = NA, adj =0,cex.idn = 1,col.idn = par("col"),
lty.cutoff,lwd.cutoff,col.cutoff = "red",text.abline = TRUE,
text.abline.x = NULL, text.abline.y = NULL,cex.abline = par("cex"),
col.abline = col.cutoff,font.abline = par("font"), adj.abline = c(0,0),
text.abline.x.x = NULL, text.abline.x.y = NULL, text.abline.y.x = NULL,
text.abline.y.y = NULL, text.abline.x.fmt.cx = "%7.2f",
text.abline.x.fmt.qx = "%4.2f%%", text.abline.y.fmt.cy = "%7.2f",
text.abline.y.fmt.qy = "%4.2f%%", jitter.fac = 10,
jitter.tol = .Machine$double.eps, doplot = TRUE)
Arguments
data |
data in |
... |
further arguments to be passed to |
dist.x |
object of class |
dist.y |
object of class |
cutoff.x |
object of class |
cutoff.y |
object of class |
cutoff.quantile.x |
numeric; the cutoff quantile for the |
cutoff.quantile.y |
numeric; the cutoff quantile for the |
transform.x |
function; a transformation to be performed before determining the
distances of the |
transform.y |
function; a transformation to be performed before determining the
distances of the |
id.n |
a set of indices (or a corresponding logical vector); to select a subset
of the data in argument |
cex.pts |
the corresponding |
lab.pts |
a vector of labels for the (unsubsetted) |
jitter.pts |
the corresponding |
alpha.trsp |
alpha transparency to be added ex post to colors
|
adj |
the corresponding argument for |
cex.idn |
the corresponding |
col.idn |
the corresponding |
lty.cutoff |
the corresponding |
lwd.cutoff |
(vector cast to length 2): the corresponding |
col.cutoff |
(vector cast to length 2): the corresponding |
text.abline |
vector of logicals (cast to length 2): shall text be added to cutoff lines. |
text.abline.x |
text to be added to cutoff lines in x direction; if |
text.abline.y |
text to be added to cutoff lines in y direction; if |
cex.abline |
vector of numerics (cast to length 2): cex-value for added cutoff text. |
col.abline |
vector of length 2: color for added cutoff text. |
font.abline |
vector of length 2: font for added cutoff text. |
adj.abline |
cast to 2 x 2 matrix (by recycling rules): adjustment values for added cutoff text. |
text.abline.x.y |
y-coordinate of text to be added to cutoff lines in x direction;
if |
text.abline.y.x |
x-coordinate of text to be added to cutoff lines in y direction;
if |
text.abline.x.x |
x-coordinate of text to be added to cutoff lines in x direction;
if |
text.abline.y.y |
y-coordinate of text to be added to cutoff lines in y direction;
if |
text.abline.x.fmt.cx |
format string (see |
text.abline.x.fmt.qx |
format string to format cutoff probability in label in x direction. |
text.abline.y.fmt.cy |
format string to format the cutoff value in label in y direction. |
text.abline.y.fmt.qy |
format string to format cutoff probability in label in y direction. |
jitter.fac |
factor for jittering, see |
jitter.tol |
threshold for jittering: if distance between points is smaller
than |
doplot |
logical; shall a plot be produced? if |
Details
performs the plotting for ddPlot
and outlyingPlotIC
;
all arguments except for data
are optional. In case they are missing
default values are used as usual; for those arguments without default arguments,
we do
- transform.x
defaults to identity, internally
.
- id.n
defaults to
1:ncol(data)
, internally
.
- lab.pts
defaults to
(1:ncol(data))[id.n]
, internally
.
- lwd.cutoff
defaults to argument
lwd
, if given, else topar{lwd}
, internally
.
- lty.cutoff
defaults to argument
lty
, if given, else topar{lty}
, internally
.
Value
a list (returned as invisible()
) with items
id.x |
the indices of (possibly transformed) data (within subset |
id.y |
the indices of (possibly transformed) data (within subset |
id.xy |
the indices of (possibly transformed) data (within subset |
qtx |
the quantiles of the distances of the (possibly transformed) data in |
qty |
the quantiles of the distances of the (possibly transformed) data in |
cutoff.x.v |
the cutoff value in |
cutoff.y.v |
the cutoff value in |
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
See Also
plot.default
, par
,
ddPlot
, outlyingPlotIC
Examples
MX <- matrix(rnorm(1500),nrow=6)
QM <- matrix(rnorm(36),nrow=6); QM <- QM %*% t(QM)
RobAStBase:::.ddPlot.MatNtNtCoCo(data=MX,
dist.y=QFNorm(QuadF=PosSemDefSymmMatrix(QM)),
xlab="Norm.x",ylab="Norm.y", cex.idn = 1.3, offset=0,
lwd=2, lwd.cutoff=4, lty=2, col.cutoff =2, col.idn="green",
col = "blue", adj=0.4, pos=4,id.n = sample(1:200,size=100),
lab.pts=letters,log="x", main="GA", sub="NO",cex.sub=0.2)
Internal / Helper functions of package RobAStBase for plot functions
Description
These functions are internally used helper functions for plot
,
infoPlot
comparePlot
in package RobAStBase.
Usage
.rescalefct(x, fct, scaleX = FALSE, scaleX.fct, scaleX.inv,
scaleY = FALSE, scaleY.fct = pnorm,
xlim, ylim, dots)
.plotRescaledAxis(scaleX, scaleX.fct, scaleX.inv, scaleY,scaleY.fct,
scaleY.inv, xlim, ylim, X, ypts = 400, n = 11,
finiteEndpoints = rep(FALSE,4),
x.ticks = NULL, y.ticks = NULL, withbox = TRUE)
.legendCoord(x, scaleX, scaleX.fct, scaleY, scaleY.fct)
.SelectOrderData(data, fct, which.lbs, which.Order, which.nonlbs = NULL)
.makedotsP(dots)
.makedotsLowLevel(dots)
.cexscale(y, y1=y, maxcex=4,mincex=0.05,cex, fun=NULL)
.getX.vec(distr, dims0, lty, x.vec, scaleX, scaleX.fct, scaleX.inv, xm, xM)
.getXlimYlim(dots,dotsP, dims0, xlim, ylim)
.prepareTitles(withSubst, presubArg2, presubArg3, dots, mainText,
L2Fam, inner, dims0, dims, to.draw, trafO, obj, type, bmar, tmar)
.getToDraw(dims, trafO, L2Fam, to.draw.arg, Abs=NULL)
.preparePanelFirstLast(with.automatic.grid , dims0, pF.0, pL.0,
logArg, scaleX, scaleY, x.ticks, y.ticks, scaleX.fct, scaleY.fct)
Arguments
scaleX |
logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)? |
scaleY |
logical; shall Y-axis be rescaled (by default according to a probit scale)? |
scaleX.fct |
an isotone, vectorized function mapping the domain of the IC
to [0,1]; if |
scaleX.inv |
the inverse function to |
scaleY.fct |
an isotone, vectorized function mapping for each coordinate the
range of the respective coordinate of the IC
to [0,1]; defaulting to the cdf of |
scaleY.inv |
an isotone, vectorized function mapping for each coordinate
the range [0,1] into the range of the respective coordinate of the IC;
defaulting to the quantile function of |
fct |
for |
xlim |
for one-panel plots: numeric vector of length 2: limits of the plotted x region (in original scale), for multi-panel plots: can be matrix valued (with two columns and as many rows as panels). |
ylim |
for one-panel plots: numeric vector of length 2: limits of the plotted y region (in original scale), for multi-panel plots: can be matrix valued (with two columns and as many rows as panels). |
finiteEndpoints |
a logical of length 4: are the unscaled |
x.ticks |
numeric: coordinates in original scale of user-given ticks on x-axis. |
y.ticks |
numeric: coordinates in original scale of user-given ticks on y-axis. |
n |
integer: number of default ticks in x and y axis. |
X |
numeric: x-values on [0,1]-scale from which to produce range of x axis. |
ypts |
integer: number of y-points to be generated on [0,1] range to produce y-axis. |
dots |
dots argument for later calls to |
x |
coordinates of the legend placement to be rescaled when using a scale transformation. |
data |
numeric or data.frame containing numerics; observations to be plotted into a graph. |
which.lbs |
either an integer vector with the indices of the observations
to be plotted into graph or |
which.Order |
indices of the observations after ordering which are to be
plotted into the graph; more speficically, the indices are obtained after
a possible thin-out by |
which.nonlbs |
indices of the observations which should be plotted but
not labelled; either an integer vector with the indices of the observations
to be plotted into graph or |
withbox |
logical of length 1. If |
y |
input at which to compute |
y1 |
secondary input of |
maxcex |
maximal value for |
mincex |
minimal value for |
cex |
basic factor for |
fun |
(optional) function to compute the |
L2Fam |
L2-Family |
,
to.draw.arg |
resp. argument from the user-interface of |
distr |
underlying distribution of the observations |
dims0 |
number of panels to be plotted |
lty |
the |
x.vec |
the resp. argument from the user interface. |
xm |
minimal x-value |
xM |
maximal x-value |
dotsP |
the internal |
withSubst |
should substitutions be made in titles? |
presubArg2 |
title part |
presubArg3 |
title part |
mainText |
text to be used for |
inner |
the resp. argument from the user interface. |
dims |
the dimension of the pIC |
to.draw |
the actual numbers / names of the plotted panels. |
trafO |
the parameter transformation of |
obj |
the object from which to draw the name (of the plot). |
type |
for which type of plot should the titles be produced – |
bmar |
resp. argument from the user-interface of |
tmar |
resp. argument from the user-interface of |
Abs |
additional text template used in |
with.automatic.grid |
generate a grid automatically. |
pF.0 |
the |
pL.0 |
the |
logArg |
a character vector with |
Details
.rescalefct
rescales, if necessary, x and y axis for use in plot
functions. More specifically, if scaleX
is TRUE
rescales x,
if scaleY
is TRUE
rescales fct(x) (otherwise leaves them
unchanges); to this end uses trafos scaleX.fct
with inverse
scaleX.inv
, resp. scaleY.fct
; it respects xlim
and ylim
(given in orig. scale), thins out the scaled values if
necessary and accordingly modifies slots xaxt
, yaxt
, and
axes
of argument dots
to indicate the new axes have to be drawn;
using the paradigm small letters to denote values on original scale and
capital letters on transformed scale, its return value is a list with
(thinned out) values of x and y, X and Y and modified dots.
.plotRescaledAxis
plots rescaled axes according to logicals
scaleX
, scaleY
; to this end uses trafos scaleX.fct
with
inverse scale.inv
, resp. scaleY.fct
, scaleY.inv
;
it respects xlim
and ylim
. By default, ot produces the x axes according
to the values in argument X
, and the y axes as an equidistant grid of
length ypts
on [0,1] (on transformed scale); each of these axes, again
by default will have n
tick values; these are however thinned out if
the come to lie too close to each other on transformed scale.
Instead of producing automatically chosen tick values, the user may explicitly
require x-ticks and y-ticks values on the axes, using arguments x.ticks
and y-ticks
. This function has no return value.
.legendCoord
produces, if needed (i.e., if coordinates are not
given as strings like "bottomright"
), rescaled coordinates for the
placement of a legend.
.SelectOrderData
, for data to be plotted into the graph,
performs two optional selections: a first selection on the unordered (original)
data (acc. to argument which.lbs
) and a second selection according to
which.Order
on the data remaining after the first selection and ordered
according to argument fct
; the return value is a list with elements
data
, ie., the selected/thinned out data, y
, ie., the
values of fct(data)
, ind
, ie., the indices of the selected data
in the original data (after possibly two selections), and ind1
the
indices of the data selected by which.lbs
in the original data; in
addition also the non selected data, data.ns
, the respective
y-values y.ns
and the corresponding index elements ind.ns
are
returned as list items.
.makedotsP
and .makedotsLowLevel
manipulate the ...
argument, deleting certain items and selecting items which can be digested by
plot
, returning the manipulated list.
.cexscale
rescales the point sizes of the points to be plotted;
the unscaled sizes are given in argument y
, y1
in
case of several lines of points to be plotted may contain the
vector of the sizes of all points to be plotted in (e.g., including
those of the other lines of points). maxcex
and mincex
are maximum and minimum of the raw rescaled sizes; cex
is
a factor drawn from argument cex.pts
by which the raw sizes
are rescaled before being returned. fun
is the function
by which the rescaling is done; by default this argument is NULL
and in this case the function log(1+abs(x))
is used.
.getDimsTD
returns the number of different coordinates to be plotted.
.producePanelFirstS
for each graphical panel inserts
(if needed) x and y tickmarks for user-specific axes
into a panel.first
expression.
.getX.vec
produces the x-grid (on original scale) for each of the panels
and decides whether to plot lines or points.
.getXlimYlim
produces panel-wise xlim
and ylim
arguments
as well as left and right endpoints of the x-scalas.
.prepareTitles
produces the titles for the panels.
.getToDraw
computes which panels are to be drawn.
.preparePanelFirstLast
prepares the panel.first
and panel.last
expressions for each of the panels.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
Internal functions for qqplot of package RobAStBase
Description
These functions are used internally by qqplot of package RobAStBase.
Usage
.fadeColor(col,x, bg = "white")
Arguments
col |
(a vector of) color(s) |
x |
a (numeric) vector of fading weights |
bg |
a color (of length 1): the background color against which to fade |
Details
.fadecolor
uses function colorRamp
to interpolate between
color col
and bg
, at coordinate given by x
.
Value
.fadecolor |
a vector of (rgb) colors of same length as |
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de,
See Also
ks.test
, qqplot
,internals_qqplot
,internals_qqplot
, qqplot
, qqplot
Interpolated Risks
Description
Class of risks for which algorithms dispatch to speed-up algorithms
Usage
MBRRisk(samplesize=100)
OMSRRisk(samplesize=100)
RMXRRisk(samplesize=100)
Arguments
samplesize |
sample size at which to look at the risk. |
Details
The main purpose of classes OMSRRisk
, MBRRisk
, and
RMXRRisk
is to help to dispatch into speed-up algorithms later
in function roptest
. In all these risks, we assume
convex contamination neighborhoods.
OMSRRisk
stands for optimal MSE-robust estimation (where we assume
a radius r of 0.5
), RMXRRisk
stands for optimal
optimally RMX-robust estimation and MBRRisk
stands for optimal
Bias-robust estimation.
All these risks have an additional slot samplesize, defaulting to 100
,
and for which there is a replacement and an accessor method.
Objects from the Class
interpolRisk
is a virtual class: No objects may be created from it.
the other classes are generated via generating functions.
Slots
type
Object of class
"character"
: type of risk. (Inherited fromRiskType
).
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
Examples
new("OMSRRisk")
OMSRRisk()
RMXRRisk()
MBRRisk()
myrisk <- MBRRisk(samplesize=100)
samplesize(myrisk)
samplesize(myrisk) <- 20
kStepEstimate-class.
Description
Class of asymptotically linear estimates.
Objects from the Class
Objects can be created by calls of the form new("kStepEstimate", ...)
.
More frequently they are created via the generating function
kStepEstimator
.
Slots
name
Object of class
"character"
: name of the estimator.estimate
Object of class
"ANY"
: estimate.estimate.call
Object of class
"call"
: call by which estimate was produced.samplesize
object of class
"numeric"
— the samplesize (only complete cases are counted) at which the estimate was evaluated.completecases
:object of class
"logical"
— complete cases at which the estimate was evaluated.asvar
object of class
"OptionalNumericOrMatrix"
which may contain the asymptotic (co)variance of the estimator.asbias
Optional object of class
"numeric"
: asymptotic bias.pIC
Optional object of class
InfluenceCurve
: influence curve.nuis.idx
object of class
"OptionalNumeric"
: indices ofestimate
belonging to the nuisance part.fixed
object of class
"OptionalNumeric"
: the fixed and known part of the parameter.steps
Object of class
"integer"
: number of steps.Infos
object of class
"matrix"
with two columns namedmethod
andmessage
: additional informations.trafo
object of class
"list"
: a list with componentsfct
andmat
(see below).untransformed.estimate
:Object of class
"ANY"
: untransformed estimate.untransformed.asvar
:object of class
"OptionalNumericOrMatrix"
which may contain the asymptotic (co)variance of the untransformed estimator.pICList
Optional object of class
"OptionalpICList"
: the list of (intermediate) (partial) influence curves used; only filled when called fromkStepEstimator
with argumentwithPICList==TRUE
.ICList
Optional object of class
"OptionalpICList"
: the list of (intermediate) (total) influence curves used; only filled when called fromkStepEstimator
with argumentwithICList==TRUE
.start
The argument
start
— of class"StartClass"
used in call tokStepEstimator
.startval
Object of class
matrix
: the starting value with which the k-step Estimator was initialized (inp
-space / transformed).ustartval
Object of class
matrix
: the starting value with which the k-step Estimator was initialized (ink
-space / untransformed).ksteps
Object of class
"OptionalMatrix"
: the intermediate estimates (inp
-space) for the parameter; only filled when called fromkStepEstimator
.uksteps
Object of class
"OptionalMatrix"
: the intermediate estimates (ink
-space) for the parameter; only filled when called fromkStepEstimator
.robestcall
Object of class
"OptionalCall"
, i.e., acall
orNULL
: only filled when called fromroptest
in package ROptEst.
Extends
Class "ALEstimate"
, directly.
Class "Estimate"
, by class "ALEstimate"
Methods
- steps
signature(object = "kStepEstimate")
: accessor function for slotsteps
.- ksteps
signature(object = "kStepEstimate")
: accessor function for slotksteps
; has additional argumentdiff
, defaulting toFALSE
; if the latter isTRUE
, the starting value from slotstartval
is prepended as first column; otherwise we return the corresponding increments in each step.- uksteps
signature(object = "kStepEstimate")
: accessor function for slotuksteps
; has additional argumentdiff
, defaulting toFALSE
; if the latter isTRUE
, the starting value from slotustartval
is prepended as first column; otherwise we return the corresponding increments in each step.- start
signature(object = "kStepEstimate")
: accessor function for slotstart
.- startval
signature(object = "kStepEstimate")
: accessor function for slotstartval
.- ustartval
signature(object = "kStepEstimate")
: accessor function for slotstartval
.- ICList
signature(object = "kStepEstimate")
: accessor function for slotICList
.- pICList
signature(object = "kStepEstimate")
: accessor function for slotpICList
.- robestCall
signature(object = "kStepEstimate")
: accessor function for slotrobestCall
.- timings
signature(object = "kStepEstimate")
: accessor function for attribute"timings"
.- show
signature(object = "kStepEstimate")
: a show method;
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de and Peter Ruckdeschel peter.ruckdeschel@uni-oldenurg.de
See Also
Function for the computation of k-step estimates
Description
Function for the computation of k-step estimates.
Usage
kStepEstimator(x, IC, start = NULL, steps = 1L,
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
withICList = getRobAStBaseOption("withICList"),
withPICList = getRobAStBaseOption("withPICList"),
na.rm = TRUE, startArgList = NULL, ...,
withLogScale = TRUE, withEvalAsVar = TRUE,
withMakeIC = FALSE, E.argList = NULL, diagnostic = FALSE)
Arguments
x |
sample |
IC |
object of class |
start |
initial estimate (for full parameter,i.e. in dimension |
steps |
integer: number of steps |
useLast |
which parameter estimate (initial estimate or
k-step estimate) shall be used to fill the slots |
withUpdateInKer |
if there is a non-trivial trafo in the model with matrix |
IC.UpdateInKer |
if there is a non-trivial trafo in the model with matrix |
na.rm |
logical: if |
startArgList |
a list of arguments to be given to argument |
withPICList |
logical: shall slot |
withICList |
logical: shall slot |
... |
additional parameters |
withLogScale |
logical; if |
withEvalAsVar |
logical; if |
withMakeIC |
logical; if |
E.argList |
|
diagnostic |
logical; if |
Details
Given an initial estimation start
, a sample x
and an influence curve IC
the corresponding k-step
estimator is computed.
The default value of argument useLast
is set by the
global option kStepUseLast
which by default is set to
FALSE
. In case of general models useLast
remains unchanged during the computations. However, if
slot CallL2Fam
of IC
generates an object of
class "L2GroupParamFamily"
the value of useLast
is changed to TRUE
.
Explicitly setting useLast
to TRUE
should
be done with care as in this situation the influence curve
is re-computed using the value of the one-step estimate
which may take quite a long time depending on the model.
If useLast
is set to TRUE
and slot modifyIC
of IC
is filled with some function (which can be
used to re-compute the IC for a different parameter), the
computation of asvar
, asbias
and IC
is
based on the k-step estimate.
Timings for the several substeps are available as attribute
timings
of the return value.
Diagnostics on the involved integrations are available if argument
diagnostic
is TRUE
. Then there is attribute diagnostic
attached to the return value, which may be inspected
and accessed through showDiagnostic
and
getDiagnostic
.
Value
Object of class "kStepEstimate"
.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de,
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
## don't run to reduce check time on CRAN
if(require(ROptEst)){
## 1. generate a contaminated sample
ind <- rbinom(100, size=1, prob=0.05)
x <- rnorm(100, mean=0, sd=(1-ind) + ind*9)
## 2. Kolmogorov(-Smirnov) minimum distance estimator
(est0 <- MDEstimator(x=x, NormLocationScaleFamily()))
## 3. k-step estimation: radius known
N1 <- NormLocationScaleFamily(mean=estimate(est0)["mean"], sd=estimate(est0)["sd"])
N1.Rob <- InfRobModel(center = N1, neighbor = ContNeighborhood(radius = 0.5))
IC1 <- optIC(model = N1.Rob, risk = asMSE())
(est1 <- kStepEstimator(x, IC1, est0, steps = 3, withPIC = TRUE))
estimate(est1)
ksteps(est1)
pICList(est1)
start(est1)
attr(est1,"timings")
## a transformed model
tfct <- function(x){
nms0 <- c("mean","sd")
nms <- "comb"
fval0 <- x[1]+2*x[2]
names(fval0) <- nms
mat0 <- matrix(c(1,2), nrow = 1, dimnames = list(nms,nms0))
return(list(fval = fval0, mat = mat0))
}
N1.traf <- N1; trafo(N1.traf) <- tfct
N1R.traf <- N1.Rob; trafo(N1R.traf) <- tfct
IC1.traf <- optIC(model = N1R.traf, risk = asMSE())
(est0.traf <- MDEstimator(x, N1.traf))
(est1.traf <- kStepEstimator(x, IC1.traf, est0, steps = 3,
withIC = TRUE, withPIC = TRUE, withUpdateInKer = FALSE))
(est1a.traf <- kStepEstimator(x, IC1.traf, est0, steps = 3,
withIC = TRUE, withPIC = TRUE, withUpdateInKer = TRUE))
estimate(est1.traf)
ksteps(est1.traf)
pICList(est1.traf)
startval(est1.traf)
untransformed.estimate(est1.traf)
uksteps(est1.traf)
ICList(est1.traf)
ustartval(est1.traf)
estimate(est1a.traf)
ksteps(est1a.traf)
pICList(est1a.traf)
startval(est1a.traf)
untransformed.estimate(est1a.traf)
uksteps(est1a.traf)
ICList(est1a.traf)
ustartval(est1a.traf)
}
Methods for function kStepEstimator.start in Package ‘RobAStBase’
Description
kStepEstimator.start-methods; these are called from within
kStepEstimator
to produce a numeric value of for the starting estimator
in the end.
Usage
kStepEstimator.start(start, ...)
## S4 method for signature 'numeric'
kStepEstimator.start(start, nrvalues, ...)
## S4 method for signature 'Estimate'
kStepEstimator.start(start, nrvalues, ...)
## S4 method for signature 'function'
kStepEstimator.start(start, x, nrvalues, na.rm, L2Fam, startList)
Arguments
start |
the start slot of an object of class |
nrvalues |
numeric; dimension |
x |
the data at which the starting estimator is to be evaluated. |
na.rm |
logical: if |
startList |
a list of arguments to be given to the call to |
L2Fam |
the parametric famliy; |
... |
further arguments for |
Value
a numeric vector with the corresponding value of the start estimator
(in k
space)
Methods
- kStepEstimator.start
signature(start = "numeric")
: returns the unchanged argumentstart
if it has the correct length; otherwise throws an error.- kStepEstimator.start
signature(start = "Estimate")
: returns slotuntransformed.estimate
ofstart
if it is notNULL
, and else slotestimate
if the latter has dimensionnrvalues
.- kStepEstimator.start
signature(start = "function")
: returnskStepEstimator.start(do.call(start, args=c(list(x,L2Fam),startList)
where, ifna.rm == TRUE
, beforehandx
has been modified tox <- complete.cases(x)
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
See Also
kStepEstimator
,ALEstimate-class
Generic function for the computation of location M estimates
Description
Generic function for the computation of location M estimates.
Usage
locMEstimator(x, IC, ...)
## S4 method for signature 'numeric,InfluenceCurve'
locMEstimator(x, IC, eps = .Machine$double.eps^0.5, na.rm = TRUE)
Arguments
x |
sample |
IC |
object of class |
... |
additional parameters |
eps |
the desired accuracy (convergence tolerance). |
na.rm |
logical: if |
Details
Given some sample x
and some influence curve IC
an M estimate is computed by solving the corresponding
M equation.
Value
Object of class "MEstimate"
Methods
- x = "numeric", IC = "InfluenceCurve"
univariate location.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Huber, P.J. (1964) Robust estimation of a location parameter. Ann. Math. Stat. 35: 73–101.
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
InfluenceCurve-class
, MEstimate-class
Generic Function for making ICs consistent at a possibly different model
Description
Generic function for providing centering and Fisher consistency of ICs.
Usage
makeIC(IC, L2Fam, ...)
## S4 method for signature 'IC,L2ParamFamily'
makeIC(IC, L2Fam, ..., diagnostic = FALSE)
## S4 method for signature 'list,L2ParamFamily'
makeIC(IC, L2Fam, forceIC = TRUE, name, Risks,
Infos, modifyIC = NULL, ..., diagnostic = FALSE)
## S4 method for signature 'function,L2ParamFamily'
makeIC(IC, L2Fam, forceIC = TRUE, name,
Risks, Infos, modifyIC = NULL, ..., diagnostic = FALSE)
Arguments
IC |
object of class |
L2Fam |
L2-differentiable family of probability measures; may be missing,
in which case it is replaced by the family in slot |
forceIC |
logical; shall centeredness and Fisher consistency be enforced applying an affine linear transformation? |
name |
Object of class |
Risks |
object of class |
Infos |
matrix of characters with two columns
named |
modifyIC |
object of class |
... |
additional parameters to be passed to expectation |
diagnostic |
logical; if |
Details
Argument IC
is transformed affinely such that the transformed IC
satisfies the defining side conditions of an IC, i.e., centeredness and
Fisher consistency:
\mathop{\bm{E}}[{\rm IC}]=0
\mathop{\bm{E}}[{\rm IC}\,\Lambda^\tau]= D
where \Lambda
is the L2 derivative of the model and D is
the Jacobian of transformation trafo
.
Diagnostics on the involved integrations are available if argument
diagnostic
is TRUE
. Then there is attribute diagnostic
attached to the return value, which may be inspected
and accessed through showDiagnostic
and
getDiagnostic
.
Value
An IC of class "IC"
at the model.
Methods
- makeIC
signature(IC = "IC", L2Fam = "missing"
: creates an object of class"IC"
at the parametric model of its own slotCallL2Fam
; enforces IC conditions centeredness and Fisher consistency, applying an affine linear transformation.- makeIC
signature(IC = "IC", L2Fam = "L2ParamFamily"
: creates an object of class"IC"
at the parametric modelL2Fam
; enforces IC conditions centeredness and Fisher consistency, applying an affine linear transformation.- makeIC
signature(IC = "list", L2Fam = "L2ParamFamily"
: creates an object of class"IC"
out of a list of functions given by argumentIC
at the parametric modelL2Fam
; enforces IC conditions centeredness and Fisher consistency, applying an affine linear transformation.- makeIC
signature(IC = "function", L2Fam = "L2ParamFamily"
: creates an object of class"IC"
out of a function given by argumentIC
at the parametric modelL2Fam
; enforces IC conditions centeredness and Fisher consistency, applying an affine linear transformation.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
Examples
## default IC
IC1 <- new("IC")
## L2-differentiable parametric family
B <- BinomFamily(13, 0.3)
## check IC properties
checkIC(IC1, B)
## make IC
IC2 <- makeIC(IC1, B)
## check IC properties
checkIC(IC2)
## slot modifyIC is filled in case of IC2
IC3 <- modifyIC(IC2)(BinomFamily(13, 0.2), IC2)
checkIC(IC3)
## identical to
checkIC(IC3, BinomFamily(13, 0.2))
IC4 <- makeIC(sin, B)
checkIC(IC4)
(IC5 <- makeIC(list(function(x)x^3), B, name="a try"))
plot(IC5)
checkIC(IC5)
## don't run to reduce check time on CRAN
N0 <- NormLocationScaleFamily()
IC6 <- makeIC(list(sin,cos),N0)
plot(IC6)
checkIC(IC6)
getRiskIC(IC6,risk=trAsCov())$trAsCov$value
getRiskIC(IC6,risk=asBias(),neighbor=ContNeighborhood())$asBias$value
Masked Methods from Packages ‘stats’ and ‘graphics’ in Package ‘RobAStBase’
Description
masked methods from packages stats and graphics
Usage
clip(x1,...)
## S4 method for signature 'ANY'
clip(x1,x2,y1,y2)
start(x,...)
## S4 method for signature 'ANY'
start(x,...)
Arguments
x , ... |
see |
x1 , x2 , y1 , y2 |
see |
Details
In order to make accessible the otherwise masked functions
start
, clip
, we generate
corresponding S4-methods.
Value
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
Methods for Functions moving from and to reference parameter in Package ‘ROptEst’
Description
In optIC
a gain in accuracy can be obtained when computing
the optimally-robust ICs at a reference parameter of the model (instead of an
arbtirary one). To this end, moveL2Fam2RefParam
moved the model to
the reference parameter and moveICBackFromRefParam
moves the obtained
optimal IC back to the original parameter.
Usage
moveL2Fam2RefParam(L2Fam, ...)
moveICBackFromRefParam(IC, L2Fam,...)
Arguments
L2Fam |
object of class |
IC |
IC of class |
... |
further arguments to be passed on. |
Details
moveL2Fam2RefParam
and moveICBackFromRefParam
are used
internally in functions robest
and roptest
to compute the
optimally robust influence function according to the arguments given to them.
Value
moveL2Fam2RefParam |
the L2 Family transformed to reference parameter. |
moveICBackFromRefParam |
the backtransformed IC. |
Methods
- moveL2Fam2RefParam
signature(L2Fam = "L2ParamFamily")
: returnsL2Fam
unchanged.- moveL2Fam2RefParam
signature(L2Fam = "L2LocationFamily")
: movesL2Fam
to location0
.- moveL2Fam2RefParam
signature(L2Fam = "L2ScaleFamily")
: movesL2Fam
to location0
and scale1
.- moveL2Fam2RefParam
signature(L2Fam = "L2LocationScaleFamily")
: movesL2Fam
to location0
and scale1
.- moveL2Fam2RefParam
signature(L2Fam = "L2LocationUnknownScaleFamily")
: movesL2Fam
to location0
and scale1
.- moveL2Fam2RefParam
signature(L2Fam = "L2ScaleUnknownLocationFamily")
: movesL2Fam
to location0
and scale1
.- moveICBackFromRefParam
signature(IC = "IC", L2Fam = "L2ParamFamily")
: returnsIC
unchanged.- moveICBackFromRefParam
signature(IC = "IC", L2Fam = "L2LocationFamily")
: moves IC inIC
back to original location inL2Fam
.- moveICBackFromRefParam
signature(IC = "IC", L2Fam = "L2ScaleFamily")
: moves IC inIC
back to original location and scale inL2Fam
, rescaling risk where necessary.- moveICBackFromRefParam
signature(IC = "IC", L2Fam = "L2LocationScaleFamily")
: moves IC inIC
back to original location and scale inL2Fam
, rescaling risk where necessary.- moveICBackFromRefParam
signature(IC = "IC", L2Fam = "L2LocationUnknownScaleFamily")
: moves IC inIC
back to original location and scale inL2Fam
, rescaling risk where necessary.- moveICBackFromRefParam
signature(IC = "IC", L2Fam = "L2ScaleUnknownLocationFamily")
: moves IC inIC
back to original location and scale inL2Fam
, rescaling risk where necessary.- moveICBackFromRefParam
signature(IC = "HampIC", L2Fam = "L2ParamFamily")
: moves IC inIC
back to original location and scale inL2Fam
(and in addition changes Lagrange multipliers accordingly), rescaling risk where necessary.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
Methods for Function normtype in Package ‘RobAStBase’
Description
normtype-methods
Methods
- normtype
signature(object = "interpolrisk")
: returns the slotnormtype
of an object of class"interpolrisk"
.
Examples
myrisk <- MBRRisk(samplesize=100)
normtype(myrisk)
Function for the computation of one-step estimates
Description
Function for the computation of one-step estimates.
Usage
oneStepEstimator(x, IC, start = NULL,
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
na.rm = TRUE, startArgList = NULL, withMakeIC = FALSE, ...,
E.argList = NULL)
Arguments
x |
sample |
IC |
object of class |
start |
initial estimate (for full parameter,i.e. in dimension |
useLast |
which parameter estimate (initial estimate or
one-step estimate) shall be used to fill the slots |
withUpdateInKer |
if there is a non-trivial trafo in the model with matrix |
IC.UpdateInKer |
if there is a non-trivial trafo in the model with matrix |
na.rm |
logical: if |
startArgList |
a list of arguments to be given to argument |
withMakeIC |
logical; if |
... |
additional arguments |
E.argList |
|
Details
Given an initial estimation start
, a sample x
and an influence curve IC
the corresponding one-step
estimator is computed.
In case IC
is an object of class "IC"
the slots asvar
and asbias
of the return
value are filled (based on the initial estimate).
The default value of argument useLast
is set by the
global option kStepUseLast
which by default is set to
FALSE
. In case of general models useLast
remains unchanged during the computations. However, if
slot CallL2Fam
of IC
generates an object of
class "L2GroupParamFamily"
the value of useLast
is changed to TRUE
.
Explicitly setting useLast
to TRUE
should
be done with care as in this situation the influence curve
is re-computed using the value of the one-step estimate
which may take quite a long time depending on the model.
If useLast
is set to TRUE
and slot modifyIC
of IC
is filled with some function (which can be
used to re-compute the IC for a different parameter), the
computation of asvar
, asbias
and IC
is
based on the one-step estimate.
Value
Object of class "kStepEstimate"
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de,
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
InfluenceCurve-class
, kStepEstimate-class
Generic function for the computation of optimally robust ICs
Description
Generic function for the computation of optimally robust ICs.
Usage
optIC(model, risk, ...)
## S4 method for signature 'L2ParamFamily,asCov'
optIC(model, risk, withMakeIC = FALSE, ...)
Arguments
model |
probability model. |
risk |
object of class |
... |
additional parameters (here used for |
withMakeIC |
logical; if |
Details
The classical optimal IC which ist optimal in sense of the Cramer-Rao bound is computed.
Value
Some optimally robust IC is computed.
Methods
- model = "L2ParamFamily", risk = "asCov"
computes classical optimal influence curve for L2 differentiable parametric families.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.
Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.
See Also
InfluenceCurve-class
, RiskType-class
Examples
B <- BinomFamily(size = 25, prob = 0.25)
## classical optimal IC
IC0 <- optIC(model = B, risk = asCov())
plot(IC0) # plot IC
checkIC(IC0, B)
Function outlyingPlotIC in Package ‘RobAStBase’
Description
outlyingPlotIC produces an outlyingness plot based on distances applied to ICs
Usage
outlyingPlotIC(data,IC.x, IC.y = IC.x, dist.x = NormType(), dist.y,
cutoff.x = cutoff.sememp(0.95), cutoff.y = cutoff.chisq(0.95), ...,
cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x,
id.n, cex.pts = 1, lab.pts, jitter.pts = 0, alpha.trsp = NA, adj, cex.idn,
col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE,
text.abline.x = NULL, text.abline.y = NULL, cex.abline = par("cex"),
col.abline = col.cutoff, font.abline = par("font"), adj.abline = c(0,0),
text.abline.x.x = NULL, text.abline.x.y = NULL, text.abline.y.x = NULL,
text.abline.y.y = NULL, text.abline.x.fmt.cx = "%7.2f",
text.abline.x.fmt.qx = "%4.2f%%", text.abline.y.fmt.cy = "%7.2f",
text.abline.y.fmt.qy = "%4.2f%%", robCov.x = TRUE, robCov.y = TRUE,
tf.x = NULL,tf.y = NULL, jitter.fac=10, jitter.tol=.Machine$double.eps,
doplot = TRUE,
main = gettext("Outlyingness \n by means of a distance-distance plot")
)
Arguments
data |
data coercable to |
IC.x |
object of class |
IC.y |
object of class |
... |
further arguments to be passed to |
dist.x |
object of class |
dist.y |
object of class |
cutoff.x |
object of class |
cutoff.y |
object of class |
cutoff.quantile.x |
numeric; the cutoff quantile for the |
cutoff.quantile.y |
numeric; the cutoff quantile for the |
id.n |
a set of indices (or a corresponding logical vector); to select a subset
of the data in argument |
cex.pts |
the corresponding |
lab.pts |
a vector of labels for the (unsubsetted) |
jitter.pts |
the corresponding |
alpha.trsp |
alpha transparency to be added ex post to colors
|
adj |
the corresponding argument for |
cex.idn |
the corresponding |
col.idn |
the corresponding |
lty.cutoff |
the corresponding |
lwd.cutoff |
the corresponding |
col.cutoff |
the corresponding |
text.abline |
vector of logicals (cast to length 2): shall text be added to cutoff lines. |
text.abline.x |
text to be added to cutoff lines in x direction; if |
text.abline.y |
text to be added to cutoff lines in y direction; if |
cex.abline |
vector of numerics (cast to length 2): cex-value for added cutoff text. |
col.abline |
vector of length 2: color for added cutoff text. |
font.abline |
vector of length 2: font for added cutoff text. |
adj.abline |
cast to 2 x 2 matrix (by recycling rules): adjustment values for added cutoff text. |
text.abline.x.y |
y-coordinate of text to be added to cutoff lines in x direction;
if |
text.abline.y.x |
x-coordinate of text to be added to cutoff lines in y direction;
if |
text.abline.x.x |
x-coordinate of text to be added to cutoff lines in x direction;
if |
text.abline.y.y |
y-coordinate of text to be added to cutoff lines in y direction;
if |
text.abline.x.fmt.cx |
format string (see |
text.abline.x.fmt.qx |
format string to format cutoff probability in label in x direction. |
text.abline.y.fmt.cy |
format string to format the cutoff value in label in y direction. |
text.abline.y.fmt.qy |
format string to format cutoff probability in label in y direction. |
robCov.x |
shall x-distances be based on MCD, i.e., robust covariances (TRUE) or on classical covariance be used? |
robCov.y |
shall y-distances be based on MCD, i.e., robust covariances (TRUE) or on classical covariance be used? |
tf.x |
transformation for x axis: a function returning the
transformed x-coordinates when applied to the data;
if |
tf.y |
transformation for y axis: a function returning the
transformed y-coordinates when applied to the data;
if |
jitter.fac |
factor for jittering, see |
jitter.tol |
threshold for jittering: if distance between points is smaller
than |
doplot |
logical; shall a plot be produced? if |
main |
the main title. |
Details
calls a corresponding ddPlot
method to produce the plot.
Value
If argument doplot
is FALSE
:
A list (returned as invisible()
) with items
id.x |
the indices of (possibly transformed) data (within subset |
id.y |
the indices of (possibly transformed) data (within subset |
id.xy |
the indices of (possibly transformed) data (within subset |
qtx |
the quantiles of the distances of the (possibly transformed) data in |
qty |
the quantiles of the distances of the (possibly transformed) data in |
cutoff.x.v |
the cutoff value in |
cutoff.y.v |
the cutoff value in |
If argument doplot
is TRUE
:
An S3 object of class c("plotInfo","DiagnInfo")
, i.e., a list
containing the information needed to produce the
respective plot, which at a later stage could be used by different
graphic engines (like, e.g. ggplot
) to produce the plot
in a different framework. A more detailed description will follow in
a subsequent version.a list (returned as invisible()
) with items;
one item is retV
which is the return value in case doplot
is FALSE
.
Note
If you want to use the return value of cutoff.quant()
for arguments
cutoff.x
or cutoff.y
, remember to set the arguments tf.x
resp. tf.y
to the identity, i.e., function(x)x
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
Examples
if(require(ROptEst)){
## generates normal location and scale family with mean = -2 and sd = 3
N0 <- NormLocationScaleFamily()
N0.IC0 <- optIC(model = N0, risk = asCov())
N0.Rob1 <- InfRobModel(center = N0, neighbor = ContNeighborhood(radius = 0.5))
N0.IC1 <- optIC(model = N0.Rob1, risk = asMSE())
set.seed(123)
xn <- c(rnorm(100),rcauchy(20)+20)
outlyingPlotIC(xn, IC.x=N0.IC0)
outlyingPlotIC(xn, IC.x=N0.IC1)
## example for usage with cutoff.quant()
classIC <- optIC(NormLocationScaleFamily(mean = 3.3, sd = 0.67),
risk = asCov())
outlyingPlotIC(data = chem[-17], classIC, cex.pts = 3, jitter.fac = 1,
cutoff.x = cutoff.quant(), tf.x =function(x)(x))
}
Methods for Function plot in Package ‘RobAStBase’
Description
plot-methods
Usage
plot(x, y, ...)
## S4 method for signature 'IC,missing'
plot(x, ..., withSweave = getdistrOption("withSweave"),
main = FALSE, inner = TRUE, sub = FALSE,
col.inner = par("col.main"), cex.inner = 0.8,
bmar = par("mar")[1], tmar = par("mar")[3],
with.automatic.grid = TRUE,
with.legend = FALSE, legend = NULL, legend.bg = "white",
legend.location = "bottomright", legend.cex = 0.8,
withMBR = FALSE, MBRB = NA, MBR.fac = 2, col.MBR = par("col"),
lty.MBR = "dashed", lwd.MBR = 0.8,
x.vec = NULL, scaleX = FALSE, scaleX.fct, scaleX.inv,
scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm,
scaleN = 9, x.ticks = NULL, y.ticks = NULL,
mfColRow = TRUE, to.draw.arg = NULL,
withSubst = TRUE)
## S4 method for signature 'IC,numeric'
plot(x, y, ...,
cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"),
pch.pts = 19,
cex.npts = 1, cex.npts.fun = NULL, col.npts = par("col"),
pch.npts = 20,
jitter.fac = 1, with.lab = FALSE, cex.lbs = 1, adj.lbs = c(0,0),
col.lbs = col.pts, lab.pts = NULL, lab.font = NULL,
alpha.trsp = NA, which.lbs = NULL,
which.Order = NULL, which.nonlbs = NULL, attr.pre = FALSE,
return.Order = FALSE)
Arguments
x |
object of class |
y |
missing or numeric (a dataset, e.g.) |
withSweave |
logical: if |
main |
logical: is a main title to be used? or |
inner |
logical: do panels have their own titles? or |
sub |
logical: is a sub-title to be used? or |
tmar |
top margin – useful for non-standard main title sizes |
bmar |
bottom margin – useful for non-standard sub title sizes |
cex.inner |
magnification to be used for inner titles relative
to the current setting of |
col.inner |
character or integer code; color for the inner title |
with.automatic.grid |
logical; should a grid be plotted alongside
with the ticks of the axes, automatically? If |
with.legend |
logical; shall a legend be plotted? |
legend |
either |
legend.location |
a valid argument |
legend.bg |
background color for the legend |
legend.cex |
magnification factor for the legend |
withMBR |
logical; shall horizontal lines with min and max of MBRE be plotted for comparison? |
MBRB |
matrix (or |
MBR.fac |
positive factor; scales the bounds given by argument |
col.MBR |
color for the MBR lines; as usual |
lty.MBR |
line type for the MBR lines; as usual |
lwd.MBR |
line width for the MBR lines; as usual |
x.vec |
a numeric vector of grid points to evaluate the influence curve;
by default, |
scaleX |
logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)? |
scaleY |
logical; shall Y-axis be rescaled (by default according to a probit scale)? |
scaleX.fct |
an isotone, vectorized function mapping the domain of the IC
to [0,1]; if |
scaleX.inv |
the inverse function to |
scaleY.fct |
an isotone, vectorized function mapping for each coordinate the
range of the respective coordinate of the IC
to [0,1]; defaulting to the cdf of |
scaleY.inv |
an isotone, vectorized function mapping for each coordinate
the range [0,1] into the range of the respective coordinate of the IC;
defaulting to the quantile function of |
scaleN |
integer; defaults to 9; on rescaled axes, number of x and y ticks if drawn automatically; |
x.ticks |
numeric; defaults to NULL; (then ticks are chosen automatically); if non-NULL, user-given x-ticks (on original scale); |
y.ticks |
numeric; defaults to NULL; (then ticks are chosen automatically); if non-NULL, user-given y-ticks (on original scale); can be a list with one (numeric or NULL) item per panel |
mfColRow |
shall default partition in panels be used — defaults to |
to.draw.arg |
Either |
withSubst |
logical; if |
cex.pts |
size of the points of the second argument plotted, can be a vector;
if argument |
cex.pts.fun |
rescaling function for the size of the points to be plotted;
either |
col.pts |
color of the points of the second argument plotted, can
be a vector as in |
pch.pts |
symbol of the points of the second argument plotted, can
be a vector as in |
col.npts |
color of the non-labelled points of the |
pch.npts |
symbol of the non-labelled points of the |
cex.npts |
size of the non-labelled points of the |
cex.npts.fun |
rescaling function for the size of the non-labelled points
to be plotted; either |
with.lab |
logical; shall labels be plotted to the observations? |
cex.lbs |
size of the labels; can be vectorized to a matrix of dim nlbs x npnl where npnl is the number of plotted panels and nlbs the number of plotted labels; if it is a vector, it is recylced in order label then panel. |
col.lbs |
color of the labels; can be vectorized as |
adj.lbs |
adjustment of the labels; can be vectorized to a 2 x npnl matrix, npnl the number of plotted panels; if it is a vector, it is recycled in order (x,y)-coords then panel. |
lab.pts |
character or NULL; labels to be plotted to the observations; if |
lab.font |
font to be used for labels (of the observations). |
alpha.trsp |
alpha transparency to be added ex post to colors
|
jitter.fac |
jittering factor used in case of a |
attr.pre |
logical; do graphical attributes for plotted data refer
to indices prior ( |
which.lbs |
either an integer vector with the indices of the observations
to be plotted into graph or |
which.Order |
we order the observations (descending) according to the norm given by
|
which.nonlbs |
indices of the observations which should be plotted but
not labelled; either an integer vector with the indices of the observations
to be plotted into graph or |
return.Order |
logical; if |
... |
further parameters for |
Details
Any parameters of plot.default
may be passed on to this particular
plot
method.
We start describing the IC,missing
-method:
For main-, inner, and subtitles given as arguments main
,
inner
, and sub
, top and bottom margins are enlarged to 5 resp.
6 by default but may also be specified by tmar
/ bmar
arguments.
If main
/ inner
/ sub
are
logical then if the respective argument is FALSE
nothing is done/plotted,
but if it is TRUE
, we use a default main title taking up the calling
arguments in case of main
, default inner titles taking up the
class and (named) parameter slots of arguments in case of inner
,
and a "generated on <data>"-tag in case of sub
.
Of course, if main
/ inner
/ sub
are character
, this
is used for the title; in case of inner
it is then checked whether it
has correct length. If argument withSubst
is TRUE
, in all title
and axis lable arguments, the following patterns are substituted:
"%C"
class of argument
object
"%A"
deparsed argument
object
"%D"
time/date-string when the plot was generated
If argument ...
contains argument ylim
, this may either be
as in plot.default
(i.e. a vector of length 2) or a vector of
length 2*(number of plotted dimensions + 2),
where the first two elements are the values for ylim
in panel "d", the first two are for ylim
resp. xlim
for panels "p" and "q", and the last 2*(number of plotted dimensions)
are the values for ylim
for the plotted dimensions of the L2derivative,
one pair for each dimension.
The IC,numeric
-method calls the IC,missing
-method but in
addition plots the values of a dataset into the IC.
In addition, argument ...
may contain arguments panel.first
,
panel.last
, i.e., hook expressions to be evaluated at the very beginning
and at the very end of each panel (within the then valid coordinates).
To be able to use these hooks for each panel individually, they may also be
lists of expressions (of the same length as the number of panels and
run through in the same order as the panels).
Value
An S3 object of class c("plotInfo","DiagnInfo")
, i.e., a list
containing the information needed to produce the
respective plot, which at a later stage could be used by different
graphic engines (like, e.g. ggplot
) to produce the plot
in a different framework. A more detailed description will follow in
a subsequent version.
Examples
IC1 <- new("IC")
plot(IC1)
plot(IC1, main = TRUE, panel.first= grid(),
col = "blue", cex.main = 2, cex.inner = 1)
### selection of subpanels for plotting
N <- NormLocationScaleFamily(mean=0, sd=1)
IC2 <- optIC(model = N, risk = asCov())
par(mfrow=c(1,1))
plot(IC2, main = TRUE, panel.first= grid(),
col = "blue", cex.main = 2, cex.inner = 0.6,
mfColRow = FALSE, to.draw.arg=c("sd"))
## xlim and ylim arguments
plot(IC2, main = TRUE, panel.first= grid(),
ylim=c(-3,3), xlim=c(-2,3))
plot(IC2, main = TRUE, panel.first= grid(),
ylim=c(-3,3,-1,3), xlim=c(-2,3),
with.legend = TRUE)
data <- r(N)(30)
plot(IC2, data, panel.first= grid(),
ylim = c(-3,3,-1,3), xlim=c(-2,3),
cex.pts = 3, pch.pts = 1:2, col.pts="green",
with.lab = TRUE, which.lbs = c(1:4,15:20),
which.Order = 1:6, return.Order = TRUE)
Methods for Function qqplot in Package ‘RobAStBase’
Description
We generalize function qqplot
from package stats to
be applicable to distribution and probability model objects. In this context,
qqplot
produces a 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.
Graphical parameters may be given as arguments to qqplot
.
Usage
qqplot(x, y, ...)
## S4 method for signature 'ANY,RobModel'
qqplot(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'
qqplot(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'
qqplot(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
- qqplot
signature(x = "ANY", y = "RobModel")
: produces a QQ plot of a datasetx
against the theoretical quantiles of distribution of robust modely
.- qqplot
signature(x = "ANY", y = "InfRobModel")
: produces a QQ plot of a datasetx
against the theoretical quantiles of distribution of infinitesimally robust modely
.- qqplot
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, ifwith.lab==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 qqplot
from package stats: a
list with components
x |
The x coordinates of the points that were/would be plotted |
y |
The corresponding quantiles of the second distribution,
including |
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
References
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
qqplot
from package stats – the standard QQ plot
function, qqplot
from package distr for
comparisons of distributions, and
qqplot
from package distrMod (which
is called intermediately by this method), as well as
qqbounds
, used by qqplot
to produce confidence
intervals.
Examples
## \donttest to reduce check time
qqplot(rnorm(40, mean = 15, sd = sqrt(30)), Chisq(df=15))
RobM <- InfRobModel(center = NormLocationFamily(mean=13,sd=sqrt(28)),
neighbor = ContNeighborhood(radius = 0.4))
x <- rnorm(20, mean = 15, sd = sqrt(30))
qqplot(x, RobM)
qqplot(x, RobM, alpha.CI=0.9, add.points.CI=FALSE)
## further examples for ANY,kStepEstimator-method
## in example to roptest() in package ROptEst
Methods for Function rescaleFunction in Package ‘RobAStBase’
Description
rescaleFunction
provides the default rescaling for
a particular L2-Family for wrapper functions PlotIC
, ComparePlotIC
,
InfoPlot
, and CniperPointPlot
.
Usage
rescaleFunction(L2Fam, ...)
## S4 method for signature 'ANY'
rescaleFunction(L2Fam, ...)
Arguments
L2Fam |
an object of class "L2ParamFamily" to be dispatched on. |
... |
further arguments for the particular methods not be dispatched on. |
Details
rescaleFunction
is realized as an S4 method in order to be
able to provide default rescalings for (new) particular L2 Families ex post
to be used in the wrapper functions.
Value
a list with arguments needed for the rescaling by internal function
.rescalefct
; more specifically it always
contains items scaleX
and scaleY
, and if dataFlag==TRUE
,
also items scaleX.fct
, scaleX.inv
, scaleY.fct
,
scaleY.inv
, x.ticks
, y.ticks
.
Author(s)
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de,
Mykhailo Pupashenko myhailo.pupashenko@gmail.com
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
Methods for Function samplesize in Package ‘RobAStBase’
Description
samplesize-methods
Methods
- samplesize
signature(object = "interpolrisk")
: returns the slotsamplesize
of an object of class"interpolrisk"
.- samplesize<-
signature(object = "interpolrisk", value = "ANY")
: modifies the slotsamplesize
of an object of class"interpolrisk"
.
Examples
myrisk <- MBRRisk(samplesize=100)
samplesize(myrisk)
samplesize(myrisk) <- 20