[Distr-commits] r559 - in branches/distr-2.2/pkg/distrMod: R chm man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 31 19:01:43 CEST 2009


Author: ruckdeschel
Date: 2009-08-31 19:01:41 +0200 (Mon, 31 Aug 2009)
New Revision: 559

Added:
   branches/distr-2.2/pkg/distrMod/R/MCEstimate.R
Modified:
   branches/distr-2.2/pkg/distrMod/R/AllClass.R
   branches/distr-2.2/pkg/distrMod/R/Estimate.R
   branches/distr-2.2/pkg/distrMod/R/internalMleCalc.R
   branches/distr-2.2/pkg/distrMod/R/mleCalc-methods.R
   branches/distr-2.2/pkg/distrMod/chm/00Index.html
   branches/distr-2.2/pkg/distrMod/chm/MCEstimate-class.html
   branches/distr-2.2/pkg/distrMod/chm/distrMod.chm
   branches/distr-2.2/pkg/distrMod/chm/distrMod.toc
   branches/distr-2.2/pkg/distrMod/chm/meRes.html
   branches/distr-2.2/pkg/distrMod/man/MCEstimate-class.Rd
   branches/distr-2.2/pkg/distrMod/man/meRes.Rd
Log:
MCEstimate-class gains slot startPar; corresponding accessor functions;

Modified: branches/distr-2.2/pkg/distrMod/R/AllClass.R
===================================================================
--- branches/distr-2.2/pkg/distrMod/R/AllClass.R	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/R/AllClass.R	2009-08-31 17:01:41 UTC (rev 559)
@@ -428,7 +428,8 @@
          representation(criterion = "numeric",
                         criterion.fct = "function",
                         method = "character",
-                        optimwarn = "character"),
+                        optimwarn = "character",
+                        startPar = "ANY"),
          prototype(name = "Minimum criterion estimate",
                    estimate = numeric(0),
                    samplesize = numeric(0),
@@ -444,7 +445,8 @@
                    trafo = list(fct = function(x){
                                       list(fval = x, mat = matrix(1))},
                                 mat = matrix(1)),
-                   optimwarn = ""
+                   optimwarn = "",
+                   startPar = NULL
                    ),
          contains = "Estimate")
 

Modified: branches/distr-2.2/pkg/distrMod/R/Estimate.R
===================================================================
--- branches/distr-2.2/pkg/distrMod/R/Estimate.R	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/R/Estimate.R	2009-08-31 17:01:41 UTC (rev 559)
@@ -81,15 +81,7 @@
                as.matrix(object at untransformed.asvar)
            else NULL    )
 
-setMethod("optimwarn", "MCEstimate", function(object) object at optimwarn)
-setMethod("criterion", "MCEstimate", function(object) object at criterion)
-setMethod("criterion.fct", "MCEstimate", function(object) object at criterion.fct)
-setMethod("method", "MCEstimate", function(object) object at method)
 
-setReplaceMethod("criterion", "MCEstimate", 
-                  function(object, value) {object at criterion <- value; object})
-
-
 setMethod("nuisance", "Estimate", function(object) { 
       if(is.null(object at nuis.idx))
          return(NULL)

Added: branches/distr-2.2/pkg/distrMod/R/MCEstimate.R
===================================================================
--- branches/distr-2.2/pkg/distrMod/R/MCEstimate.R	                        (rev 0)
+++ branches/distr-2.2/pkg/distrMod/R/MCEstimate.R	2009-08-31 17:01:41 UTC (rev 559)
@@ -0,0 +1,22 @@
+###############################################################################
+## Functions and methods for "MCEstimate" classes
+###############################################################################
+
+
+setMethod("optimwarn", "MCEstimate", function(object) object at optimwarn)
+setMethod("criterion", "MCEstimate", function(object) object at criterion)
+setMethod("criterion.fct", "MCEstimate", function(object) object at criterion.fct)
+setMethod("method", "MCEstimate", function(object) object at method)
+
+setReplaceMethod("criterion", "MCEstimate", 
+                  function(object, value) {object at criterion <- value; object})
+
+setMethod("startPar", "MCEstimate", function(object){
+ if(is.null(object at startPar)){
+   cat(gettext("No starting value used.\n"))
+   return(invisible(NULL))
+ }else{
+   return(object at startPar)
+ }
+ })
+

Modified: branches/distr-2.2/pkg/distrMod/R/internalMleCalc.R
===================================================================
--- branches/distr-2.2/pkg/distrMod/R/internalMleCalc.R	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/R/internalMleCalc.R	2009-08-31 17:01:41 UTC (rev 559)
@@ -115,7 +115,8 @@
                   untransformed.estimate = untransformed.estimate,
                   untransformed.asvar = untransformed.asvar,
                   criterion.fct = res$crit.fct, method = res$method,
-                  fixed = fixed(param), optimwarn = res$warns)
+                  fixed = fixed(param), optimwarn = res$warns,
+                  startPar = res$startPar)
     return(res.me)
 }
 

Modified: branches/distr-2.2/pkg/distrMod/R/mleCalc-methods.R
===================================================================
--- branches/distr-2.2/pkg/distrMod/R/mleCalc-methods.R	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/R/mleCalc-methods.R	2009-08-31 17:01:41 UTC (rev 559)
@@ -13,11 +13,13 @@
 
 meRes <- function(x, estimate, criterion.value, param, crit.fct,
                   method = "explicit solution",
-                  crit.name = "Maximum Likelihood", Infos, warns = "")
+                  crit.name = "Maximum Likelihood", Infos, warns = "",
+                  startPar = NULL)
         return(list(estimate = estimate, criterion = criterion.value,
                     param = param, crit.fct = crit.fct, method = method, 
                     crit.name = crit.name, Infos = Infos, 
-                    samplesize = samplesize(x), warns=warns))
+                    samplesize = samplesize(x), warns = warns,
+                    startPar = startPar))
 
 get.criterion.fct <- function(theta, Data, ParamFam, criterion.ff, fun, ...){
 
@@ -171,7 +173,8 @@
                                    criterion.ff = criterion, fun2, ...)
     
     return(meRes(x, theta, crit, param, crit.fct, method = method,
-                 crit.name = crit.name, Infos = Infos, warns= allwarns))
+                 crit.name = crit.name, Infos = Infos, warns= allwarns,
+                 startPar = startPar))
            })
 
 ################################################################################

Modified: branches/distr-2.2/pkg/distrMod/chm/00Index.html
===================================================================
--- branches/distr-2.2/pkg/distrMod/chm/00Index.html	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/chm/00Index.html	2009-08-31 17:01:41 UTC (rev 559)
@@ -702,6 +702,8 @@
 <td>onesided Bias Type</td></tr>
 <tr><td width="25%"><a href="ParamFamily-class.html">startPar</a></td>
 <td>Parametric family of probability measures.</td></tr>
+<tr><td width="25%"><a href="MCEstimate-class.html">startPar,MCEstimate-method</a></td>
+<td>MCEstimate-class.</td></tr>
 <tr><td width="25%"><a href="ParamFamily-class.html">startPar,ParamFamily-method</a></td>
 <td>Parametric family of probability measures.</td></tr>
 <tr><td width="25%"><a href="symmetricBias.html">symmetricBias</a></td>

Modified: branches/distr-2.2/pkg/distrMod/chm/MCEstimate-class.html
===================================================================
--- branches/distr-2.2/pkg/distrMod/chm/MCEstimate-class.html	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/chm/MCEstimate-class.html	2009-08-31 17:01:41 UTC (rev 559)
@@ -10,9 +10,10 @@
 <param name="keyword" value="R:   criterion,MCEstimate-method">
 <param name="keyword" value="R:   criterion.fct">
 <param name="keyword" value="R:   criterion.fct,MCEstimate-method">
+<param name="keyword" value="R:   startPar,MCEstimate-method">
 <param name="keyword" value="R:   method">
+<param name="keyword" value="R:   method,MCEstimate-method">
 <param name="keyword" value="R:   optimwarn">
-<param name="keyword" value="R:   method,MCEstimate-method">
 <param name="keyword" value="R:   optimwarn,MCEstimate-method">
 <param name="keyword" value="R:   criterion<-">
 <param name="keyword" value="R:   criterion<-,MCEstimate-method">
@@ -69,17 +70,29 @@
 additional informations. </dd>
 <dt><code>optimwarn</code></dt><dd> object of class <code>"character"</code>
 warnings issued during optimization. </dd>
+<dt><code>startPar</code></dt><dd> &mdash; object of class <code>"ANY"</code>; filled either
+with <code>NULL</code> (no starting value used) or with <code>"numeric"</code>
+&mdash; the value of the starting parameter. </dd>
 <dt><code>asvar</code></dt><dd> object of class <code>"OptionalMatrix"</code>
 which may contain the asymptotic (co)variance of the estimator. </dd>
 <dt><code>samplesize</code></dt><dd> object of class <code>"numeric"</code> &mdash;
 the samplesize at which the estimate was evaluated. </dd>
 <dt><code>nuis.idx</code></dt><dd> object of class <code>"OptionalNumeric"</code>: 
 indices of <code>estimate</code> belonging to the nuisance part</dd>
+<dt><code>fixed</code></dt><dd> object of class <code>"OptionalNumeric"</code>:
+the fixed and known part of the parameter. </dd>
+<dt><code>trafo</code></dt><dd> object of class <code>"list"</code>:
+a list with components <code>fct</code> and <code>mat</code> (see below). </dd>
 <dt><code>untransformed.estimate</code></dt><dd>Object of class <code>"ANY"</code>:
 untransformed estimate.</dd>
 <dt><code>untransformed.asvar</code></dt><dd> object of class <code>"OptionalNumericOrMatrix"</code>
 which may contain the asymptotic (co)variance of the untransformed 
 estimator. </dd>
+<dt><code>completecases</code></dt><dd> object of class <code>"logical"</code> &mdash;
+complete cases at which the estimate was evaluated. </dd>
+<dt><code>startPar</code></dt><dd> object of class <code>"ANY"</code>; usually filled with
+argument <code>startPar</code> of generating function <code>MCEstimator</code>,
+<code>MLEstimator</code>, <code>MDEstimator</code>.</dd>
 </dl>
 
 </p>
@@ -109,6 +122,10 @@
 accessor function for slot <code>optimwarn</code>. </dd>
 </p>
 <p>
+<dt>startPar</dt><dd><code>signature(object = "MCEstimate")</code>:
+accessor function for slot <code>startPar</code>. </dd>
+</p>
+<p>
 <dt>criterion.fct</dt><dd><code>signature(object = "MCEstimate")</code>:
 accessor function for slot <code>criterion.fct</code>. </dd>
 </p>

Modified: branches/distr-2.2/pkg/distrMod/chm/distrMod.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distrMod/chm/distrMod.toc
===================================================================
--- branches/distr-2.2/pkg/distrMod/chm/distrMod.toc	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/chm/distrMod.toc	2009-08-31 17:01:41 UTC (rev 559)
@@ -1174,6 +1174,10 @@
 <param name="Local" value="ParamFamily-class.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="startPar,MCEstimate-method">
+<param name="Local" value="MCEstimate-class.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="startPar,ParamFamily-method">
 <param name="Local" value="ParamFamily-class.html">
 </OBJECT>

Modified: branches/distr-2.2/pkg/distrMod/chm/meRes.html
===================================================================
--- branches/distr-2.2/pkg/distrMod/chm/meRes.html	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/chm/meRes.html	2009-08-31 17:01:41 UTC (rev 559)
@@ -25,7 +25,7 @@
 
 <pre>
 meRes(x, estimate, criterion.value, param, crit.fct, method = "explicit solution",
-      crit.name = "Maximum Likelihood", Infos, warns = "")
+      crit.name = "Maximum Likelihood", Infos, warns = "", startPar = NULL)
 get.criterion.fct(theta, Data, ParamFam, criterion.ff, fun, ...)
 ## S4 method for signature 'numeric':
 samplesize(object)
@@ -89,6 +89,9 @@
 wrapper to the criterion function used in the MCE
 (with certain checking whether parameter value is permitted and possibly
 penalizing if not; see code to , for example.)</td></tr>
+<tr valign="top"><td><code>startPar</code></td>
+<td>
+value of argument <code>StartPar</code> &mdash; starting parameter used.</td></tr>
 <tr valign="top"><td><code>...</code></td>
 <td>
 further arguments to be passed 

Modified: branches/distr-2.2/pkg/distrMod/man/MCEstimate-class.Rd
===================================================================
--- branches/distr-2.2/pkg/distrMod/man/MCEstimate-class.Rd	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/man/MCEstimate-class.Rd	2009-08-31 17:01:41 UTC (rev 559)
@@ -5,9 +5,10 @@
 \alias{criterion,MCEstimate-method}
 \alias{criterion.fct}
 \alias{criterion.fct,MCEstimate-method}
+\alias{startPar,MCEstimate-method}
 \alias{method}
+\alias{method,MCEstimate-method}
 \alias{optimwarn}
-\alias{method,MCEstimate-method}
 \alias{optimwarn,MCEstimate-method}
 \alias{criterion<-}
 \alias{criterion<-,MCEstimate-method}
@@ -48,17 +49,29 @@
       additional informations. }
     \item{\code{optimwarn}}{ object of class \code{"character"}
       warnings issued during optimization. }
+    \item{\code{startPar}}{ --- object of class \code{"ANY"}; filled either
+     with \code{NULL} (no starting value used) or with \code{"numeric"}
+      --- the value of the starting parameter. }
     \item{\code{asvar}}{ object of class \code{"OptionalMatrix"}
       which may contain the asymptotic (co)variance of the estimator. }
     \item{\code{samplesize}}{ object of class \code{"numeric"} ---
       the samplesize at which the estimate was evaluated. }
     \item{\code{nuis.idx}}{ object of class \code{"OptionalNumeric"}: 
      indices of \code{estimate} belonging to the nuisance part}
+    \item{\code{fixed}}{ object of class \code{"OptionalNumeric"}:
+     the fixed and known part of the parameter. }
+    \item{\code{trafo}}{ object of class \code{"list"}:
+     a list with components \code{fct} and \code{mat} (see below). }
     \item{\code{untransformed.estimate}}{Object of class \code{"ANY"}:
       untransformed estimate.}
     \item{\code{untransformed.asvar}}{ object of class \code{"OptionalNumericOrMatrix"}
       which may contain the asymptotic (co)variance of the untransformed 
       estimator. }
+    \item{\code{completecases}}{ object of class \code{"logical"} ---
+         complete cases at which the estimate was evaluated. }
+    \item{\code{startPar}}{ object of class \code{"ANY"}; usually filled with
+    argument \code{startPar} of generating function \code{MCEstimator},
+    \code{MLEstimator}, \code{MDEstimator}.}
   }
 }
 \section{Extends}{
@@ -75,6 +88,9 @@
     \item{optimwarn}{\code{signature(object = "MCEstimate")}:
       accessor function for slot \code{optimwarn}. }
 
+    \item{startPar}{\code{signature(object = "MCEstimate")}:
+      accessor function for slot \code{startPar}. }
+
     \item{criterion.fct}{\code{signature(object = "MCEstimate")}:
       accessor function for slot \code{criterion.fct}. }
 
@@ -90,6 +106,7 @@
       man page.}
   }
 }
+
 %\references{}
 \author{Matthias Kohl \email{Matthias.Kohl at stamats.de},\cr
 Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}}

Modified: branches/distr-2.2/pkg/distrMod/man/meRes.Rd
===================================================================
--- branches/distr-2.2/pkg/distrMod/man/meRes.Rd	2009-08-28 12:27:50 UTC (rev 558)
+++ branches/distr-2.2/pkg/distrMod/man/meRes.Rd	2009-08-31 17:01:41 UTC (rev 559)
@@ -9,7 +9,7 @@
 
 \usage{
 meRes(x, estimate, criterion.value, param, crit.fct, method = "explicit solution",
-      crit.name = "Maximum Likelihood", Infos, warns = "")
+      crit.name = "Maximum Likelihood", Infos, warns = "", startPar = NULL)
 get.criterion.fct(theta, Data, ParamFam, criterion.ff, fun, ...)
 \S4method{samplesize}{numeric}(object)
 }
@@ -38,6 +38,7 @@
   \item{fun}{wrapper to the criterion function used in the MCE
    (with certain checking whether parameter value is permitted and possibly
     penalizing if not; see code to , for example.)}
+  \item{startPar}{value of argument \code{StartPar} --- starting parameter used.}
   \item{\dots}{further arguments to be passed 
                to \code{optim} / \code{optimize}} 
   \item{object}{numeric; the data at which to evaluate the estimate}



More information about the Distr-commits mailing list