[Distr-commits] r90 - in pkg/distrMod: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 26 08:48:41 CET 2008


Author: stamats
Date: 2008-02-26 08:48:41 +0100 (Tue, 26 Feb 2008)
New Revision: 90

Modified:
   pkg/distrMod/DESCRIPTION
   pkg/distrMod/NAMESPACE
   pkg/distrMod/R/MCEstimator.R
   pkg/distrMod/R/MDEstimator.R
   pkg/distrMod/R/MLEstimator.R
   pkg/distrMod/man/MCEstimator.Rd
   pkg/distrMod/man/MDEstimator.Rd
   pkg/distrMod/man/MLEstimator.Rd
Log:
introduced S3-class Estimate and changed classes returned by MCEstimator, MDEstimator and MLEstimator

Modified: pkg/distrMod/DESCRIPTION
===================================================================
--- pkg/distrMod/DESCRIPTION	2008-02-26 07:47:29 UTC (rev 89)
+++ pkg/distrMod/DESCRIPTION	2008-02-26 07:48:41 UTC (rev 90)
@@ -1,6 +1,6 @@
 Package: distrMod
 Version: 2.0
-Date: 2008-02-14
+Date: 2008-02-26
 Title: Object orientated implementation of probability models
 Description: Object orientated implementation of probability models based on packages 'distr' and 'distrEx'
 Author: Florian Camphausen, Matthias Kohl, Peter Ruckdeschel, Thomas Stabla

Modified: pkg/distrMod/NAMESPACE
===================================================================
--- pkg/distrMod/NAMESPACE	2008-02-26 07:47:29 UTC (rev 89)
+++ pkg/distrMod/NAMESPACE	2008-02-26 07:48:41 UTC (rev 90)
@@ -31,7 +31,7 @@
 exportMethods("solve")
 exportMethods("existsPIC")
 exportMethods("modifyModel")
-S3method(print, MCEstimator)
+S3method(print, Estimate)
 export("PosDefSymmMatrix","PosSemDefSymmMatrix")
 export("distrModOptions", "getdistrModOption",
        "MCEstimator", "MLEstimator", "MDEstimator")

Modified: pkg/distrMod/R/MCEstimator.R
===================================================================
--- pkg/distrMod/R/MCEstimator.R	2008-02-26 07:47:29 UTC (rev 89)
+++ pkg/distrMod/R/MCEstimator.R	2008-02-26 07:48:41 UTC (rev 90)
@@ -30,10 +30,10 @@
           names(crit) <- crit.name
     }
 
-    structure(list("estimate" = theta, "criterion" = crit), class = "MCEstimator")
+    structure(list("estimate" = theta, "criterion" = crit), class = c("MCEstimate", "Estimate"))
 }
 
-## print method for objects of class MCEstimator
-print.MCEstimator <- function(x, digits = getOption("digits"), ...){
+## print method for objects of class Estimate
+print.Estimate <- function(x, digits = getOption("digits"), ...){
   print(x$estimate)
 }

Modified: pkg/distrMod/R/MDEstimator.R
===================================================================
--- pkg/distrMod/R/MDEstimator.R	2008-02-26 07:47:29 UTC (rev 89)
+++ pkg/distrMod/R/MDEstimator.R	2008-02-26 07:48:41 UTC (rev 90)
@@ -4,9 +4,10 @@
                 interval = interval, par = par, ...)
     if(missing(dist.name))
       dist.name <- names(distance(x, ParamFamily at distribution))
-    names(res)[2] <- "distance"
-    if(!is.null(dist.name)) names(res$distance) <- dist.name
-    class(res) <- c("MDEstimator", "MCEstimator")
+#    names(res)[2] <- "distance"
+#    if(!is.null(dist.name)) names(res$distance) <- dist.name
+    if(!is.null(dist.name)) names(res$criterion) <- dist.name
+    class(res) <- c("MCEstimate", "Estimate")
 
     return(res)
 }

Modified: pkg/distrMod/R/MLEstimator.R
===================================================================
--- pkg/distrMod/R/MLEstimator.R	2008-02-26 07:47:29 UTC (rev 89)
+++ pkg/distrMod/R/MLEstimator.R	2008-02-26 07:48:41 UTC (rev 90)
@@ -25,14 +25,13 @@
 MLEstimator <- function(x, ParamFamily, interval, par, ...){
     negLoglikelihood <- function(x, Distribution, ...){
         res <- -sum(log(Distribution at d(x, ...)))
-        names(res) <- "Negative Log-Likelihood"
         return(res)
     }
 
     res <- MCEstimator(x = x, ParamFamily = ParamFamily, criterion = negLoglikelihood,
                 interval = interval, par = par, ...)
     names(res$criterion) <- "negative log-likelihood"
-    class(res) <- c("MLEstimator", "MCEstimator")
+    class(res) <- c("MCEstimator", "Estimate")
 
     return(res)
 }

Modified: pkg/distrMod/man/MCEstimator.Rd
===================================================================
--- pkg/distrMod/man/MCEstimator.Rd	2008-02-26 07:47:29 UTC (rev 89)
+++ pkg/distrMod/man/MCEstimator.Rd	2008-02-26 07:48:41 UTC (rev 90)
@@ -30,9 +30,10 @@
   and possibly \code{\dots}.
 }
 \value{
-  An object of S3-class \code{"MCEstimator"}, a list with two components
+  An object of S3-class \code{"MCEstimate"} which inherits from class \code{"Estimate"}, 
+  a list with two components
   \item{estimate}{ minimum criterion parameter estimate }
-  \item{critierion}{ minimum value of the criterion }
+  \item{criterion}{ minimum value of the criterion }
 }
 %\references{  }
 \author{Matthias Kohl \email{Matthias.Kohl at stamats.de},\cr

Modified: pkg/distrMod/man/MDEstimator.Rd
===================================================================
--- pkg/distrMod/man/MDEstimator.Rd	2008-02-26 07:47:29 UTC (rev 89)
+++ pkg/distrMod/man/MDEstimator.Rd	2008-02-26 07:48:41 UTC (rev 90)
@@ -29,10 +29,10 @@
   \code{TotalVarDist} or \code{HellingerDist}.
 }
 \value{
-  An object of S3-class \code{"MDEstimator"} which inherits from 
-  class \code{"MCEstimator"}, a list with two components
+  An object of S3-class \code{"MCEstimate"} which inherits from 
+  class \code{"Estimate"}, a list with two components
   \item{estimate}{ maximum likelihood parameter estimate }
-  \item{distance resp. name of the distance }{ minimum value of the distance }
+  \item{criterion}{ minimum value of the distance }
 }
 \references{
     Huber, P.J. (1981) \emph{Robust Statistics}. New York: Wiley.

Modified: pkg/distrMod/man/MLEstimator.Rd
===================================================================
--- pkg/distrMod/man/MLEstimator.Rd	2008-02-26 07:47:29 UTC (rev 89)
+++ pkg/distrMod/man/MLEstimator.Rd	2008-02-26 07:48:41 UTC (rev 90)
@@ -26,14 +26,14 @@
   as criterion which should be minimized.
 }
 \value{
-  An object of S3-class \code{"MLEstimator"} which inherits from 
-  class \code{"MCEstimator"}, a list with two components
+  An object of S3-class \code{"MCEstimate"} which inherits from 
+  class \code{"Estimate"}, a list with two components
   \item{estimate}{ maximum likelihood parameter estimate }
-  \item{negative log-likelihood}{ minimum value of the negative log-likelihood }
+  \item{criterion}{ minimum value of the negative log-likelihood }
 }
 %\references{  }
-\author{Matthias Kohl \email{Matthias.Kohl at stamats.de},\cr
-        Peter Ruckdeschel \email{Peter.Ruckdeschel at uni-bayreuth.de}}
+\author{Matthias Kohl \email{Matthias.Kohl at stamats.de},\cr
+        Peter Ruckdeschel \email{Peter.Ruckdeschel at uni-bayreuth.de}}
 %\note{}
 \seealso{\code{\link{ParamFamily-class}}, \code{\link{ParamFamily}}, code{\link{MCEstimator}},
 \code{\link[MASS]{fitdistr}} }



More information about the Distr-commits mailing list