[Distr-commits] r886 - in branches/distr-2.5/pkg/distrMod: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 16 14:59:43 CET 2013


Author: ruckdeschel
Date: 2013-02-16 14:59:42 +0100 (Sat, 16 Feb 2013)
New Revision: 886

Modified:
   branches/distr-2.5/pkg/distrMod/R/AllClass.R
   branches/distr-2.5/pkg/distrMod/R/AllShow.R
   branches/distr-2.5/pkg/distrMod/R/L2GroupFamilies.R
   branches/distr-2.5/pkg/distrMod/R/L2ParamFamily.R
   branches/distr-2.5/pkg/distrMod/man/L2ParamFamily.Rd
   branches/distr-2.5/pkg/distrMod/man/ParamFamily-class.Rd
Log:
distrMod: 
+ParamFamily gains a slot .withMDE to control extra calls to MDEstimator that might not be necessary in robest (e.g. with GParetoFamily())
+consequence: L2LocationScaleFamilies now use median mad as starting estimator 
in robest roptest (and no longer call CvM-MDE)
+forgot to commit some changes in show() for asvar in the last round


Modified: branches/distr-2.5/pkg/distrMod/R/AllClass.R
===================================================================
--- branches/distr-2.5/pkg/distrMod/R/AllClass.R	2013-02-15 11:42:37 UTC (rev 885)
+++ branches/distr-2.5/pkg/distrMod/R/AllClass.R	2013-02-16 13:59:42 UTC (rev 886)
@@ -143,7 +143,8 @@
                            modifyParam = "function",
                            fam.call = "call",
                            startPar = "function",
-                           makeOKPar = "function"
+                           makeOKPar = "function",
+                           .withMDE = "logical"
                            ### <- new !!! (not in thesis!)
                            ### a function with argument theta
                            ###  returning distribution P_theta
@@ -156,7 +157,8 @@
                       props = character(0),
                       makeOKPar = function(param)param,
                       startPar = function(x) {},
-                      param = new("ParamFamParameter", main = 0, trafo = matrix(1))),
+                      param = new("ParamFamParameter", main = 0, trafo = matrix(1)),
+                      .withMDE = TRUE),
             contains = "ProbFamily")
 
 

Modified: branches/distr-2.5/pkg/distrMod/R/AllShow.R
===================================================================
--- branches/distr-2.5/pkg/distrMod/R/AllShow.R	2013-02-15 11:42:37 UTC (rev 885)
+++ branches/distr-2.5/pkg/distrMod/R/AllShow.R	2013-02-16 13:59:42 UTC (rev 886)
@@ -154,11 +154,13 @@
         trafo.mat <- object at trafo$mat
         trafo.fct <- object at trafo$fct
         
-        if(!is.null(object at asvar)){
+        asvar0 <- if(!is.null(object at asvar)) asvar(object) else NULL
 
-           sd0 <- sqrt(diag(object at asvar)/object at samplesize)
-           if(!is.null(object at untransformed.asvar) && all(!is.na(object at untransformed.asvar)))
-                untransformed.sd0 <- sqrt(diag(object at untransformed.asvar)/object at samplesize)
+        if(!is.null(asvar0)){
+           sd0 <- sqrt(diag(asvar0)/object at samplesize)
+           if(!is.null(untransformed.asvar(object)) &&
+                    all(!is.na(untransformed.asvar(object))))
+                untransformed.sd0 <- sqrt(diag(untransformed.asvar(object))/object at samplesize)
            else untransformed.sd0 <- NULL
            
            if(getdistrModOption("show.details")!="minimal")
@@ -201,7 +203,7 @@
 
            if(getdistrModOption("show.details")!="minimal"){
                cat(gettextf("asymptotic (co)variance (multiplied with samplesize):\n"))
-               print(object at asvar[,])
+               print(asvar(object)[,])
               }
 
            if(getdistrModOption("show.details")=="maximal"){
@@ -213,9 +215,9 @@
                       cat(gettextf("untransformed estimate:\n"))
                       print(object at untransformed.estimate, quote = FALSE)
                    }
-                   if(!is.null(object at untransformed.asvar)){
+                   if(!is.null(untransformed.asvar(object))){
                       cat(gettextf("asymptotic (co)variance of untransformed estimate (multiplied with samplesize):\n"))
-                      print(object at untransformed.asvar[,])
+                      print(untransformed.asvar(object)[,])
                      }
                    }
             }

Modified: branches/distr-2.5/pkg/distrMod/R/L2GroupFamilies.R
===================================================================
--- branches/distr-2.5/pkg/distrMod/R/L2GroupFamilies.R	2013-02-15 11:42:37 UTC (rev 885)
+++ branches/distr-2.5/pkg/distrMod/R/L2GroupFamilies.R	2013-02-16 13:59:42 UTC (rev 886)
@@ -445,7 +445,8 @@
                L2derivSymm = L2Symm,
                L2derivDistrSymm = L2DSymm,
                trafo = Tr,
-               .returnClsName = rtn),
+               .returnClsName = rtn,
+               .withMDE = FALSE),
            list(s = scale,
                l = loc,
                N = name,
@@ -482,7 +483,7 @@
     L2Fam at L2derivDistrSymm <- L2derivDistrSymm
     L2Fam at FisherInfo.fct <- FisherInfo.fct
     L2Fam at FisherInfo <- FisherInfo.fct(param)
-
+    L2Fam at .withMDE <- FALSE
     return(L2Fam)
 }
 

Modified: branches/distr-2.5/pkg/distrMod/R/L2ParamFamily.R
===================================================================
--- branches/distr-2.5/pkg/distrMod/R/L2ParamFamily.R	2013-02-15 11:42:37 UTC (rev 885)
+++ branches/distr-2.5/pkg/distrMod/R/L2ParamFamily.R	2013-02-16 13:59:42 UTC (rev 886)
@@ -13,7 +13,7 @@
                           L2derivSymm, L2derivDistr, L2derivDistrSymm,
                           FisherInfo.fct,
                           FisherInfo = FisherInfo.fct(param),
-                          .returnClsName = NULL){
+                          .returnClsName = NULL, .withMDE = TRUE){
      
     if(missing(name))
         name <- "L_2 differentiable parametric family of probability measures"
@@ -115,7 +115,8 @@
                L2derivDistrSymm = L2DSymm,
                FisherInfo.fct = Ffct,
                FisherInfo = FInfo,
-               .returnClsName = rtn),
+               .returnClsName = rtn,
+               .withMDE = wMDE0),
           list(N = name,
                D = distribution,
                DS = distrSymm,
@@ -130,7 +131,8 @@
                L2DSymm = L2derivDistrSymm,
                Ffct = FisherInfo.fct,
                FInfo = FisherInfo,
-               rtn = .returnClsName))
+               rtn = .returnClsName,
+               wMDE0 =.withMDE))
  
 
     if(is.null(.returnClsName))
@@ -152,7 +154,7 @@
     L2Fam at FisherInfo <- FisherInfo
     if(!is.null(startPar)) L2Fam at startPar <- startPar
     if(!is.null(makeOKPar)) L2Fam at makeOKPar <- makeOKPar
-
+    L2Fam at .withMDE <- .withMDE
     return(L2Fam)
 }
 

Modified: branches/distr-2.5/pkg/distrMod/man/L2ParamFamily.Rd
===================================================================
--- branches/distr-2.5/pkg/distrMod/man/L2ParamFamily.Rd	2013-02-15 11:42:37 UTC (rev 885)
+++ branches/distr-2.5/pkg/distrMod/man/L2ParamFamily.Rd	2013-02-16 13:59:42 UTC (rev 886)
@@ -19,7 +19,7 @@
                            return(function(x) {x-theta})},
               L2derivSymm, L2derivDistr, L2derivDistrSymm, 
               FisherInfo.fct, FisherInfo = FisherInfo.fct(param),
-              .returnClsName = NULL)
+              .returnClsName = NULL, .withMDE = TRUE)
 }
 \arguments{
   \item{name}{ character string: name of the family }
@@ -67,8 +67,16 @@
    \item{.returnClsName}{ the class name of the return value; by default this
    argument is \code{NULL} whereupon the return class will be 
    \code{L2ParamFamily}; but, internally, this generating function is also 
-   used to produce objects of class \code{BinomialFamily}, \code{PoisFamily}
-   \code{GammaFamily}, \code{BetaFamily}.} 
+   used to e.g. produce objects of class \code{BinomialFamily}, \code{PoisFamily}
+   \code{GammaFamily}, \code{BetaFamily}.}
+    \item{.withMDE}{ logical of length 1:
+           Tells R how to use the function from slot \code{startPar} in case
+           of a \code{kStepEstimator} --- use it as is or to compute the
+           starting point for a minimum distance estimator which in turn then
+           serves as starting point for \code{roptest} / \code{robest}
+           (from package \pkg{ROptEst}). If
+           \code{TRUE} (default) the latter alternative is used.
+           Ignored if \pkg{ROptEst} is not used.}
 }
 \details{
   If \code{name} is missing, the default 

Modified: branches/distr-2.5/pkg/distrMod/man/ParamFamily-class.Rd
===================================================================
--- branches/distr-2.5/pkg/distrMod/man/ParamFamily-class.Rd	2013-02-15 11:42:37 UTC (rev 885)
+++ branches/distr-2.5/pkg/distrMod/man/ParamFamily-class.Rd	2013-02-16 13:59:42 UTC (rev 886)
@@ -60,6 +60,15 @@
     \item{\code{props}}{[inherited from class \code{"ProbFamily"}]
       object of class \code{"character"}:
       properties of the family. }
+    \item{\code{.withMDE}}{
+           object of class \code{"logical"} (of length 1):
+           Tells R how to use the function from slot \code{startPar} in case
+           of a \code{kStepEstimator} --- use it as is or to compute the
+           starting point for a minimum distance estimator which in turn then
+           serves as starting point for \code{roptest} / \code{robest}
+           (from package \pkg{ROptEst}). If
+           \code{TRUE} (default) the latter alternative is used.
+           Ignored if \pkg{ROptEst} is not used.}
 }}
 \section{Extends}{
 Class \code{"ProbFamily"}, directly.



More information about the Distr-commits mailing list