[Robast-commits] r355 - in branches/robast-0.7/pkg: ROptEst/R ROptEst/chm ROptEst/man RobAStBase/R RobAStBase/chm RobAStBase/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Aug 27 19:27:40 CEST 2009
Author: ruckdeschel
Date: 2009-08-27 19:27:39 +0200 (Thu, 27 Aug 2009)
New Revision: 355
Modified:
branches/robast-0.7/pkg/ROptEst/R/getModifyIC.R
branches/robast-0.7/pkg/ROptEst/R/roptest.R
branches/robast-0.7/pkg/ROptEst/chm/ROptEst.chm
branches/robast-0.7/pkg/ROptEst/chm/roptest.html
branches/robast-0.7/pkg/ROptEst/man/roptest.Rd
branches/robast-0.7/pkg/RobAStBase/R/kStepEstimator.R
branches/robast-0.7/pkg/RobAStBase/R/kStepEstimatorStart.R
branches/robast-0.7/pkg/RobAStBase/R/oneStepEstimator.R
branches/robast-0.7/pkg/RobAStBase/chm/RobAStBase.chm
branches/robast-0.7/pkg/RobAStBase/chm/kStepEstimator.html
branches/robast-0.7/pkg/RobAStBase/chm/oneStepEstimator.html
branches/robast-0.7/pkg/RobAStBase/man/kStepEstimator.Rd
branches/robast-0.7/pkg/RobAStBase/man/kStepEstimatorStart-methods.Rd
branches/robast-0.7/pkg/RobAStBase/man/oneStepEstimator.Rd
Log:
ROptEst:
+fixed an error in getModifyIC in the computation of the transferred risks
+roptest now has an argument initial.est.ArgList to transmit arguments
for a call to initial.est (for those familiar with it:
similarly to startEstArgList in roptest.gpareto...)
RobAStBase:
+analogously, oneStepEstimator and kStepEstimator gain an argument
startArgList
+kStepEstimatorStart-method for function now has arguments
(start, x, nrvalues, na.rm, L2Fam, startList)
Modified: branches/robast-0.7/pkg/ROptEst/R/getModifyIC.R
===================================================================
--- branches/robast-0.7/pkg/ROptEst/R/getModifyIC.R 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/ROptEst/R/getModifyIC.R 2009-08-27 17:27:39 UTC (rev 355)
@@ -49,12 +49,25 @@
risk <- NULL
risk$asMSE <- if(is.numeric(risk0$asMSE))
risk0$asMSE * sdneu^2 / sdalt^2 else NULL
+ if(is.list(risk0$asMSE)){
+ amse <- risk0$asMSE; risk$asCov <- amse
+ if(is.numeric(amse$value))
+ risk$asMSE$value <- amse$value * sdneu^2 / sdalt^2
+ }
risk$asCov <- if(is.numeric(risk0$asCov))
risk0$asCov * sdneu^2 / sdalt^2 else NULL
- if(is.numeric(risk0$asCov$value))
- risk$asCov$value <- risk0$asCov$value * sdneu^2 / sdalt^2
+ if(is.list(risk0$asCov)){
+ aCov <- risk0$asCov; risk$asCov <- aCov
+ if(is.numeric(aCov$value))
+ risk$asCov$value <- aCov$value * sdneu^2 / sdalt^2
+ }
risk$asBias <- if(is.numeric(risk0$asBias))
risk0$asBias * sdneu / sdalt else NULL
+ if(is.list(risk0$asBias)){
+ abias <- risk0$asBias; risk$asBias <- abias
+ if(is.numeric(abias$value))
+ risk$asBias$value <- abias$value * sdneu / sdalt
+ }
return(list(A = A, d = NULL,
info = Infos(IC), w = w, risk = risk,
normtype = normtype(IC), biastype = biastype(IC),
Modified: branches/robast-0.7/pkg/ROptEst/R/roptest.R
===================================================================
--- branches/robast-0.7/pkg/ROptEst/R/roptest.R 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/ROptEst/R/roptest.R 2009-08-27 17:27:39 UTC (rev 355)
@@ -7,7 +7,7 @@
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
- na.rm = TRUE, ...){
+ na.rm = TRUE, initial.est.ArgList, ...){
es.call <- match.call()
if(missing(x))
stop("'x' is missing with no default")
@@ -67,7 +67,8 @@
nrvalues <- length(L2Fam at param)
initial.est <- kStepEstimator.start(initial.est, x = x,
nrvalues = nrvalues, na.rm = na.rm,
- ...)
+ L2Fam = L2Fam,
+ startList = initial.est.ArgList)
newParam <- param(L2Fam)
main(newParam)[] <- as.numeric(initial.est)
Modified: branches/robast-0.7/pkg/ROptEst/chm/ROptEst.chm
===================================================================
(Binary files differ)
Modified: branches/robast-0.7/pkg/ROptEst/chm/roptest.html
===================================================================
--- branches/robast-0.7/pkg/ROptEst/chm/roptest.html 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/ROptEst/chm/roptest.html 2009-08-27 17:27:39 UTC (rev 355)
@@ -30,7 +30,7 @@
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
- na.rm = TRUE, ...)
+ na.rm = TRUE, initial.est.ArgList, ...)
</pre>
@@ -103,6 +103,11 @@
<tr valign="top"><td><code>na.rm</code></td>
<td>
logical: if <code>TRUE</code>, the estimator is evaluated at <code>complete.cases(x)</code>.</td></tr>
+<tr valign="top"><td><code>initial.est.ArgList</code></td>
+<td>
+a list of arguments to be given to argument <code>start</code> if the latter
+is a function; this list by default already starts with two unnamed items,
+the sample <code>x</code>, and the model <code>L2Fam</code>.</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
further arguments </td></tr>
Modified: branches/robast-0.7/pkg/ROptEst/man/roptest.Rd
===================================================================
--- branches/robast-0.7/pkg/ROptEst/man/roptest.Rd 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/ROptEst/man/roptest.Rd 2009-08-27 17:27:39 UTC (rev 355)
@@ -12,7 +12,7 @@
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
- na.rm = TRUE, ...)
+ na.rm = TRUE, initial.est.ArgList, ...)
}
\arguments{
\item{x}{ sample }
@@ -47,6 +47,9 @@
the IC to be used for this; if \code{NULL} the result of \code{getboundedIC(L2Fam,D)} is taken;
this IC will then be projected onto \eqn{{\rm ker}(D)}{ker(D)}.}
\item{na.rm}{logical: if \code{TRUE}, the estimator is evaluated at \code{complete.cases(x)}.}
+ \item{initial.est.ArgList}{a list of arguments to be given to argument \code{start} if the latter
+ is a function; this list by default already starts with two unnamed items,
+ the sample \code{x}, and the model \code{L2Fam}.}
\item{\dots}{ further arguments }
}
\details{
Modified: branches/robast-0.7/pkg/RobAStBase/R/kStepEstimator.R
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/R/kStepEstimator.R 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/RobAStBase/R/kStepEstimator.R 2009-08-27 17:27:39 UTC (rev 355)
@@ -11,7 +11,7 @@
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
- na.rm = TRUE, ...){
+ na.rm = TRUE, startArgList = NULL, ...){
## save call
es.call <- match.call()
es.call[[1]] <- as.name("kStepEstimator")
@@ -65,7 +65,9 @@
### use dispatch here (dispatch only on start)
a.var <- if( is(start, "Estimate")) asvar(start) else NULL
IC.UpdateInKer.0 <- if(is(start,"ALEstimate")) start at pIC else NULL
- start.val <- kStepEstimator.start(start, x=x0, nrvalues = k, na.rm = na.rm, ...)
+ start.val <- kStepEstimator.start(start, x=x0, nrvalues = k,
+ na.rm = na.rm, L2Fam = L2Fam,
+ startList = startArgList)
### a starting value in k-space
Modified: branches/robast-0.7/pkg/RobAStBase/R/kStepEstimatorStart.R
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/R/kStepEstimatorStart.R 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/RobAStBase/R/kStepEstimatorStart.R 2009-08-27 17:27:39 UTC (rev 355)
@@ -21,9 +21,9 @@
})
setMethod("kStepEstimator.start", signature(start = "function"),
- function(start, x, nrvalues, na.rm, ...){
+ function(start, x, nrvalues, na.rm, L2Fam, startList){
if(na.rm) x <- na.omit(x)
- start0 <- start(x, ...)
+ start0 <- do.call(start, args=c(list(x,L2Fam),startList))
return(kStepEstimator.start(start0,nrvalues))
})
Modified: branches/robast-0.7/pkg/RobAStBase/R/oneStepEstimator.R
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/R/oneStepEstimator.R 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/RobAStBase/R/oneStepEstimator.R 2009-08-27 17:27:39 UTC (rev 355)
@@ -6,7 +6,7 @@
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
- na.rm = TRUE, ...){
+ na.rm = TRUE, startArgList = NULL, ...){
es.call <- match.call()
es.call[[1]] <- as.name("oneStepEstimator")
@@ -16,7 +16,8 @@
if(is(IC, "IC")){
erg <- kStepEstimator(x = x, IC = IC, start = start, steps = 1L,
useLast = useLast, withUpdateInKer = withUpdateInKer,
- IC.UpdateInKer = IC.UpdateInKer, na.rm = na.rm)
+ IC.UpdateInKer = IC.UpdateInKer, na.rm = na.rm,
+ startArgList = startArgList, ...)
Infos(erg) <- gsub("kStep","oneStep", Infos(erg))
erg at estimate.call <- es.call
return(erg)
@@ -36,9 +37,9 @@
if(na.rm) x0 <- na.omit(x0)
nrvalues <- dimension(IC at Curve)
- start.val <- kStepEstimator.start(start, x=x0, nrvalues = nrvalues, na.rm = na.rm,...)
+ start.val <- kStepEstimator.start(start, x=x0, nrvalues = nrvalues, na.rm = na.rm,
+ L2Fam = NULL, startList = startArgList)
-
res <- start.val + rowMeans(evalIC(IC, x0), na.rm = na.rm)
nms <- if(!is.null(dim(res))) colnames(res) else names(start.val)
dim(res) <- NULL
Modified: branches/robast-0.7/pkg/RobAStBase/chm/RobAStBase.chm
===================================================================
(Binary files differ)
Modified: branches/robast-0.7/pkg/RobAStBase/chm/kStepEstimator.html
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/chm/kStepEstimator.html 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/RobAStBase/chm/kStepEstimator.html 2009-08-27 17:27:39 UTC (rev 355)
@@ -27,7 +27,7 @@
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
- na.rm = TRUE, ...)
+ na.rm = TRUE, startArgList = NULL, ...)
</pre>
@@ -67,6 +67,11 @@
<tr valign="top"><td><code>na.rm</code></td>
<td>
logical: if <code>TRUE</code>, the estimator is evaluated at <code>complete.cases(x)</code>.</td></tr>
+<tr valign="top"><td><code>startArgList</code></td>
+<td>
+a list of arguments to be given to argument <code>start</code> if the latter
+is a function; this list by default already starts with two unnamed items,
+the sample <code>x</code>, and the model <code>eval(CallL2Fam(IC))</code>.</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
additional parameters </td></tr>
Modified: branches/robast-0.7/pkg/RobAStBase/chm/oneStepEstimator.html
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/chm/oneStepEstimator.html 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/RobAStBase/chm/oneStepEstimator.html 2009-08-27 17:27:39 UTC (rev 355)
@@ -27,7 +27,7 @@
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
- na.rm = TRUE, ...)
+ na.rm = TRUE, startArgList = NULL, ...)
</pre>
@@ -64,6 +64,13 @@
<tr valign="top"><td><code>na.rm</code></td>
<td>
logical: if <code>TRUE</code>, the estimator is evaluated at <code>complete.cases(x)</code>.</td></tr>
+<tr valign="top"><td><code>startArgList</code></td>
+<td>
+a list of arguments to be given to argument <code>start</code> if the latter
+is a function; this list by default already starts with two unnamed items,
+the sample <code>x</code>, and the model <code>eval(CallL2Fam(IC))</code>; in case <code>IC</code>
+is not of class <code>IC</code>, the model argument <code>L2Fam</code> will be set
+to <code>NULL</code>.</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
additional arguments </td></tr>
Modified: branches/robast-0.7/pkg/RobAStBase/man/kStepEstimator.Rd
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/man/kStepEstimator.Rd 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/RobAStBase/man/kStepEstimator.Rd 2009-08-27 17:27:39 UTC (rev 355)
@@ -10,7 +10,7 @@
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
- na.rm = TRUE, ...)
+ na.rm = TRUE, startArgList = NULL, ...)
}
\arguments{
\item{x}{ sample }
@@ -30,6 +30,9 @@
the IC to be used for this; if \code{NULL} the result of \code{getboundedIC(L2Fam,D)} is taken;
this IC will then be projected onto \eqn{{\rm ker}(D)}{ker(D)}.}
\item{na.rm}{logical: if \code{TRUE}, the estimator is evaluated at \code{complete.cases(x)}.}
+ \item{startArgList}{a list of arguments to be given to argument \code{start} if the latter
+ is a function; this list by default already starts with two unnamed items,
+ the sample \code{x}, and the model \code{eval(CallL2Fam(IC))}.}
\item{...}{ additional parameters }
}
\details{
Modified: branches/robast-0.7/pkg/RobAStBase/man/kStepEstimatorStart-methods.Rd
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/man/kStepEstimatorStart-methods.Rd 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/RobAStBase/man/kStepEstimatorStart-methods.Rd 2009-08-27 17:27:39 UTC (rev 355)
@@ -6,12 +6,14 @@
\alias{kStepEstimator.start,Estimate-method}
\alias{kStepEstimator.start,function-method}
\title{ Methods for function kStepEstimator.start in Package `RobAStBase' }
-\description{kStepEstimator.start-methods}
+\description{kStepEstimator.start-methods; these are called from within
+\code{kStepEstimator} to produce a numeric value of for the starting estimator
+in the end.}
\usage{
kStepEstimator.start(start, ...)
\S4method{kStepEstimator.start}{numeric}(start, nrvalues, ...)
\S4method{kStepEstimator.start}{Estimate}(start, nrvalues, ...)
-\S4method{kStepEstimator.start}{function}(start, x, nrvalues, na.rm, ...)
+\S4method{kStepEstimator.start}{function}(start, x, nrvalues, na.rm, L2Fam, startList)
}
\arguments{
\item{start}{the start slot of an object of class \code{kStepEstimator}}
@@ -20,6 +22,9 @@
main and nuisance part of the parameter.}
\item{x}{the data at which the starting estimator is to be evaluated.}
\item{na.rm}{logical: if \code{TRUE}, the estimator is evaluated at \code{complete.cases(x)}.}
+ \item{startList}{a list of arguments to be given to the call to \code{start}
+ if this is a function;}
+ \item{L2Fam}{the parametric famliy;}
\item{\ldots}{further arguments for \code{kStepEstimator.start}.}
}
\value{a numeric vector with the corresponding value of the start estimator
@@ -33,9 +38,9 @@
\code{NULL}, and else slot \code{estimate} if the latter has dimension
\code{nrvalues}.}
\item{kStepEstimator.start}{\code{signature(start = "function")}:
-returns \code{kStepEstimator.start(start(x,...))} where, if \code{na.rm == TRUE},
-beforehand \code{x} has been modified to \code{x <- complete.cases(x)}.
-}
+returns \code{kStepEstimator.start(do.call(start, args=c(list(x,L2Fam),startList)}
+where, if \code{na.rm == TRUE},
+beforehand \code{x} has been modified to \code{x <- complete.cases(x)}.}
}}
\references{
Rieder, H. (1994) \emph{Robust Asymptotic Statistics}. New York: Springer.
Modified: branches/robast-0.7/pkg/RobAStBase/man/oneStepEstimator.Rd
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/man/oneStepEstimator.Rd 2009-08-27 15:19:30 UTC (rev 354)
+++ branches/robast-0.7/pkg/RobAStBase/man/oneStepEstimator.Rd 2009-08-27 17:27:39 UTC (rev 355)
@@ -10,7 +10,7 @@
useLast = getRobAStBaseOption("kStepUseLast"),
withUpdateInKer = getRobAStBaseOption("withUpdateInKer"),
IC.UpdateInKer = getRobAStBaseOption("IC.UpdateInKer"),
- na.rm = TRUE, ...)
+ na.rm = TRUE, startArgList = NULL, ...)
}
\arguments{
\item{x}{ sample }
@@ -29,6 +29,11 @@
the IC to be used for this; if \code{NULL} the result of \code{getboundedIC(L2Fam,D)} is taken;
this IC will then be projected onto \eqn{{\rm ker}(D)}{ker(D)}.}
\item{na.rm}{logical: if \code{TRUE}, the estimator is evaluated at \code{complete.cases(x)}.}
+ \item{startArgList}{a list of arguments to be given to argument \code{start} if the latter
+ is a function; this list by default already starts with two unnamed items,
+ the sample \code{x}, and the model \code{eval(CallL2Fam(IC))}; in case \code{IC}
+ is not of class \code{IC}, the model argument \code{L2Fam} will be set
+ to \code{NULL}.}
\item{...}{ additional arguments }
}
\details{
More information about the Robast-commits
mailing list