[Robast-commits] r128 - in branches/robast-0.6/pkg/RobAStBase: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jul 28 13:33:19 CEST 2008
Author: stamats
Date: 2008-07-28 13:33:19 +0200 (Mon, 28 Jul 2008)
New Revision: 128
Modified:
branches/robast-0.6/pkg/RobAStBase/NAMESPACE
branches/robast-0.6/pkg/RobAStBase/R/AllClass.R
branches/robast-0.6/pkg/RobAStBase/R/AllGeneric.R
branches/robast-0.6/pkg/RobAStBase/R/locMEstimator.R
branches/robast-0.6/pkg/RobAStBase/man/locMEstimator.Rd
branches/robast-0.6/pkg/RobAStBase/man/oneStepEstimator.Rd
Log:
first steps towards implementation of k-step estimator
Modified: branches/robast-0.6/pkg/RobAStBase/NAMESPACE
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/NAMESPACE 2008-07-28 07:12:46 UTC (rev 127)
+++ branches/robast-0.6/pkg/RobAStBase/NAMESPACE 2008-07-28 11:33:19 UTC (rev 128)
@@ -15,7 +15,8 @@
"ContIC",
"TotalVarIC")
exportClasses("RobAStControl", "RobWeight", "BoundedWeight",
- "BdStWeight", "HampelWeight")
+ "BdStWeight", "HampelWeight")
+exportClasses("ALEstimate", "kStepEstimate", "MEstimate")
exportMethods("show",
"plot")
exportMethods("type", "radius")
@@ -48,6 +49,7 @@
exportMethods("getRiskIC")
exportMethods("getBiasIC")
exportMethods("comparePlot")
+exportMethods("pIC", "steps", "Mroot")
export("ContNeighborhood", "TotalVarNeighborhood")
export("FixRobModel", "InfRobModel")
export("InfluenceCurve", "IC", "ContIC", "TotalVarIC")
Modified: branches/robast-0.6/pkg/RobAStBase/R/AllClass.R
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/R/AllClass.R 2008-07-28 07:12:46 UTC (rev 127)
+++ branches/robast-0.6/pkg/RobAStBase/R/AllClass.R 2008-07-28 11:33:19 UTC (rev 128)
@@ -6,27 +6,27 @@
require("RandVar", character = TRUE, quietly = TRUE)
}
-# neighborhood
+## neighborhood
setClass("Neighborhood",
representation(type = "character",
radius = "numeric"),
contains = "VIRTUAL")
-# unconditional (errors-in-variables) neighborhood
+## unconditional (errors-in-variables) neighborhood
setClass("UncondNeighborhood", contains = c("Neighborhood", "VIRTUAL"))
-# unconditional convex contamination neighborhood
+## unconditional convex contamination neighborhood
setClass("ContNeighborhood", contains = "UncondNeighborhood",
prototype = prototype(type = "(uncond.) convex contamination neighborhood",
radius = 0))
-# unconditional total variation neighborhood
+## unconditional total variation neighborhood
setClass("TotalVarNeighborhood", contains = "UncondNeighborhood",
prototype = prototype(type = "(uncond.) total variation neighborhood",
radius = 0))
-# robust model
+## robust model
setClass("RobModel",
representation(center = "ProbFamily",
neighbor = "Neighborhood"),
contains = "VIRTUAL")
-# robust model with fixed (unconditional) neighborhood
+## robust model with fixed (unconditional) neighborhood
setClass("FixRobModel",
prototype = prototype(center = new("ParamFamily"),
neighbor = new("ContNeighborhood")),
@@ -38,7 +38,7 @@
stop("neighborhood radius has to be in [0, 1]")
else return(TRUE)
})
-# robust model with infinitesimal (unconditional) neighborhood
+## robust model with infinitesimal (unconditional) neighborhood
setClass("InfRobModel",
prototype = prototype(center = new("L2ParamFamily"),
neighbor = new("ContNeighborhood")),
@@ -50,7 +50,7 @@
stop("'radius' has to be in [0, Inf]")
else return(TRUE)
})
-# Weights
+## Weights
setClass("RobAStControl", representation(name ="character"),
contains = "VIRTUAL")
@@ -66,7 +66,7 @@
-# Influence curve/function with domain: EuclideanSpace
+## Influence curve/function with domain: EuclideanSpace
setClass("InfluenceCurve",
representation(name = "character",
Curve = "EuclRandVarList",
@@ -84,7 +84,7 @@
stop("'Infos' must have two columns")
else TRUE
})
-# partial incluence curve
+## partial incluence curve
setClass("IC", representation(CallL2Fam = "call"),
prototype(name = "square integrable (partial) influence curve",
Curve = EuclRandVarList(RealRandVariable(Map = list(function(x){x}),
@@ -104,7 +104,7 @@
return(TRUE)
})
-# HampIC -- common mother class to ContIC and TotalVarIC
+## HampIC -- common mother class to ContIC and TotalVarIC
setClass("HampIC",
representation(stand = "matrix",
lowerCase = "OptionalNumeric",
@@ -136,7 +136,7 @@
stop(paste("dimension of 'trafo' of 'param' != dimension of 'stand'"))
return(TRUE)
})
-# (partial) influence curve of contamination type
+## (partial) influence curve of contamination type
setClass("ContIC",
representation(clip = "numeric",
cent = "numeric"),
@@ -169,7 +169,7 @@
stop(paste("dimension of 'trafo' of 'param' != dimension of 'stand'"))
return(TRUE)
})
-# (partial) influence curve of total variation type
+## (partial) influence curve of total variation type
setClass("TotalVarIC",
representation(clipLo = "numeric",
clipUp = "numeric"),
@@ -199,4 +199,31 @@
return(TRUE)
})
-
+## ALEstimate
+setClassUnion("OptionalInfluenceCurve", c("InfluenceCurve", "NULL"))
+setClass("ALEstimate",
+ representation(pIC = "OptionalInfluenceCurve"),
+ prototype(name = "Asymptotically linear estimate",
+ estimate = numeric(0),
+ pIC = NULL,
+ Infos = matrix(c(character(0),character(0)), ncol=2,
+ dimnames=list(character(0), c("method", "message")))),
+ contains = "Estimate")
+setClass("kStepEstimate",
+ representation(steps = "integer"),
+ prototype(name = "k-step estimate",
+ estimate = numeric(0),
+ pIC = NULL,
+ steps = integer(0),
+ Infos = matrix(c(character(0),character(0)), ncol=2,
+ dimnames=list(character(0), c("method", "message")))),
+ contains = "ALEstimate")
+setClass("MEstimate",
+ representation(Mroot = "numeric"),
+ prototype(name = "M estimate",
+ estimate = numeric(0),
+ pIC = NULL,
+ Mroot = numeric(0),
+ Infos = matrix(c(character(0),character(0)), ncol=2,
+ dimnames=list(character(0), c("method", "message")))),
+ contains = "ALEstimate")
Modified: branches/robast-0.6/pkg/RobAStBase/R/AllGeneric.R
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/R/AllGeneric.R 2008-07-28 07:12:46 UTC (rev 127)
+++ branches/robast-0.6/pkg/RobAStBase/R/AllGeneric.R 2008-07-28 11:33:19 UTC (rev 128)
@@ -160,3 +160,12 @@
if(!isGeneric("comparePlot")){
setGeneric("comparePlot", function(obj1,obj2,...) standardGeneric("comparePlot"))
}
+if(!isGeneric("pIC")){
+ setGeneric("pIC", function(object) standardGeneric("pIC"))
+}
+if(!isGeneric("steps")){
+ setGeneric("steps", function(object) standardGeneric("steps"))
+}
+if(!isGeneric("Mroot")){
+ setGeneric("Mroot", function(object) standardGeneric("Mroot"))
+}
Modified: branches/robast-0.6/pkg/RobAStBase/R/locMEstimator.R
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/R/locMEstimator.R 2008-07-28 07:12:46 UTC (rev 127)
+++ branches/robast-0.6/pkg/RobAStBase/R/locMEstimator.R 2008-07-28 11:33:19 UTC (rev 128)
@@ -10,7 +10,17 @@
return(rowSums(evalIC(IC, as.matrix(x-theta))))
}
res <- uniroot(f = mest, interval = c(min(x), max(x)),
- tol = eps, x = x, IC = IC)$root
+ tol = eps, x = x, IC = IC)
+ if(is(IC, "IC")){
+ L2Fam <- eval(CallL2Fam(IC))
+ Infos <- matrix(c("locMEstimator",
+ paste("Location M estimate for", name(L2Fam))))
+ colnames(Infos) <- c("method", "message")
+ }else{
+ Infos <- matrix(c(character(0),character(0)), ncol=2,
+ dimnames=list(character(0), c("method", "message")))
+ }
- return(list(loc = res))
+ new("MEstimate", name = "Location M estimate", estimate = res$root,
+ pIC = IC, Mroot = res$f.root, Infos = Infos)
})
Modified: branches/robast-0.6/pkg/RobAStBase/man/locMEstimator.Rd
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/man/locMEstimator.Rd 2008-07-28 07:12:46 UTC (rev 127)
+++ branches/robast-0.6/pkg/RobAStBase/man/locMEstimator.Rd 2008-07-28 11:33:19 UTC (rev 128)
@@ -3,9 +3,9 @@
\alias{locMEstimator-methods}
\alias{locMEstimator,numeric,InfluenceCurve-method}
-\title{Generic function for the computation of location M estimators}
+\title{Generic function for the computation of location M estimates}
\description{
- Generic function for the computation of location M estimators.
+ Generic function for the computation of location M estimates.
}
\usage{
locMEstimator(x, IC, ...)
@@ -19,8 +19,7 @@
\item{eps}{ the desired accuracy (convergence tolerance). }
}
%\details{}
-\value{Returns a list with component
- \item{loc}{ M estimator of location }
+\value{Object of class \code{"MEstimate"}}
}
\section{Methods}{
\describe{
@@ -37,8 +36,9 @@
}
\author{Matthias Kohl \email{Matthias.Kohl at stamats.de}}
%\note{}
-\seealso{\code{\link{InfluenceCurve-class}}}
+\seealso{\code{\link{InfluenceCurve-class}}, \code{\link{MEstimate-class}} }
%\examples{}
\concept{M estimator}
\concept{estimator}
-\keyword{}
+\keyword{univar}
+\keyword{robust}
Modified: branches/robast-0.6/pkg/RobAStBase/man/oneStepEstimator.Rd
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/man/oneStepEstimator.Rd 2008-07-28 07:12:46 UTC (rev 127)
+++ branches/robast-0.6/pkg/RobAStBase/man/oneStepEstimator.Rd 2008-07-28 11:33:19 UTC (rev 128)
@@ -6,9 +6,9 @@
\alias{oneStepEstimator,numeric,InfluenceCurve,Estimate-method}
\alias{oneStepEstimator,matrix,InfluenceCurve,Estimate-method}
-\title{Generic function for the computation of one-step estimators}
+\title{Generic function for the computation of one-step estimates}
\description{
- Generic function for the computation of one-step estimators.
+ Generic function for the computation of one-step estimates.
}
\usage{
oneStepEstimator(x, IC, start)
More information about the Robast-commits
mailing list