[Distr-commits] r1262 - in branches/distr-2.8/pkg/distrMod: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 10 01:29:21 CEST 2018


Author: ruckdeschel
Date: 2018-08-10 01:29:20 +0200 (Fri, 10 Aug 2018)
New Revision: 1262

Modified:
   branches/distr-2.8/pkg/distrMod/R/MDEstimator.R
   branches/distr-2.8/pkg/distrMod/R/SimpleL2ParamFamilies.R
   branches/distr-2.8/pkg/distrMod/inst/NEWS
   branches/distr-2.8/pkg/distrMod/man/MDEstimator.Rd
Log:
[distrMod] branch 2.8: 
+ changed default for CvMMDEstiamtor to variant "Mod" (consistent to fitdistrplus)
+ extended accuracy in NbinomFamily 
+ bugfix : 
set.seed(123)
xn1 <- rnbinom(100,size=25,prob=0.2)
N1.w <- NbinomwithSizeFamily(size = 25, prob = 0.25)
x=CvMMDEstimator(xn1,N1.w,.withEvalAsVar=FALSE)

Modified: branches/distr-2.8/pkg/distrMod/R/MDEstimator.R
===================================================================
--- branches/distr-2.8/pkg/distrMod/R/MDEstimator.R	2018-08-08 01:04:10 UTC (rev 1261)
+++ branches/distr-2.8/pkg/distrMod/R/MDEstimator.R	2018-08-09 23:29:20 UTC (rev 1262)
@@ -100,7 +100,7 @@
     return(res)
 }
 
-CvMMDEstimator <- function(x, ParamFamily, muDatOrMod = c("Dat","Mod", "Other"),
+CvMMDEstimator <- function(x, ParamFamily, muDatOrMod = c("Mod", "Dat", "Other"),
                            mu = NULL,
                            paramDepDist = FALSE,
                            startPar = NULL, Infos,

Modified: branches/distr-2.8/pkg/distrMod/R/SimpleL2ParamFamilies.R
===================================================================
--- branches/distr-2.8/pkg/distrMod/R/SimpleL2ParamFamilies.R	2018-08-08 01:04:10 UTC (rev 1261)
+++ branches/distr-2.8/pkg/distrMod/R/SimpleL2ParamFamilies.R	2018-08-09 23:29:20 UTC (rev 1262)
@@ -272,6 +272,10 @@
 
 NbinomMeanSizeFamily <- function(size = 1, mean = .5, trafo,
                                  withL2derivDistr = TRUE){
+
+    TQ <- getdistrOption("TruncQuantile")
+    on.exit(distroptions(TruncQuantile=TQ))
+    distroptions(TruncQuantile=1e-8)
     name <- "Negative Binomial family"
     prob.0 <- size/(size+mean)
     distribution <- Nbinom(size = size, prob = size/(size+mean))
@@ -338,8 +342,8 @@
                    mean.0 <- main(param)["mean"]
                    size.0 <- main(param)["size"]
                    prob.00 <- size.0/(size.0+mean.0)
-                   xn <- 1:min(max(max(support(Nbinom(size = size.0, prob = prob.0))),
-                               qnbinom(1e-6,size=size.0,prob=prob.0,lower.tail=FALSE)),
+                   xn <- 1:min(max(max(support(Nbinom(size = size.0, prob = prob.00))),
+                               qnbinom(1e-6,size=size.0,prob=prob.00,lower.tail=FALSE)),
                                1e5)
                    I11 <- -sum((trigamma(xn+size.0)-trigamma(size.0))*dnbinom(xn,size=size.0,prob=prob.00))
                    I12 <- -1/prob.00

Modified: branches/distr-2.8/pkg/distrMod/inst/NEWS
===================================================================
--- branches/distr-2.8/pkg/distrMod/inst/NEWS	2018-08-08 01:04:10 UTC (rev 1261)
+++ branches/distr-2.8/pkg/distrMod/inst/NEWS	2018-08-09 23:29:20 UTC (rev 1262)
@@ -39,6 +39,7 @@
   (i.e., in discrete distiributions, with a more refined version, extending the checking
   of the numerically truncated support).
 + new model class / generator LogisticLocationScaleFamily
++ changed default for CvMMDEstiamtor to variant "Mod" (consistent to fitdistrplus)
   
 bug fixes
 + discovered some issues with local variables in L2Families (global values were used instead...)  
@@ -90,6 +91,7 @@
 + based on this tag "( mu = ... )" later on, in pkg RobAStBase, a (conditional) 
   coerce method produces the pIC of the MDE by means of .CvMMDCovariance[WithMux]
 + new subclasses "MLEstimate", "MDEstimate", "CvMMDEstimate" for internal method dispatch  
+
 ##############
 v 2.7
 ##############

Modified: branches/distr-2.8/pkg/distrMod/man/MDEstimator.Rd
===================================================================
--- branches/distr-2.8/pkg/distrMod/man/MDEstimator.Rd	2018-08-08 01:04:10 UTC (rev 1261)
+++ branches/distr-2.8/pkg/distrMod/man/MDEstimator.Rd	2018-08-09 23:29:20 UTC (rev 1262)
@@ -17,7 +17,7 @@
             penalty = 1e20, validity.check = TRUE, asvar.fct, na.rm = TRUE,
             ..., .withEvalAsVar = TRUE, nmsffx = "",
             .with.checkEstClassForParamFamily = TRUE)
-CvMMDEstimator(x, ParamFamily, muDatOrMod = c("Dat","Mod", "Other"),
+CvMMDEstimator(x, ParamFamily, muDatOrMod = c("Mod","Dat", "Other"),
             mu = NULL, paramDepDist = FALSE, startPar = NULL, Infos,
             trafo = NULL, penalty = 1e20, validity.check = TRUE, 
             asvar.fct = .CvMMDCovariance, na.rm = TRUE, ...,
@@ -52,7 +52,7 @@
         integration (probability) measure / distribution \code{mu}
         (corresponding to argument value \code{"Other"}) is to be used;
          must be one of "Dat" (default) or "Mod" or "Other".
-         You can specify just the initial letter.}
+         You can specify just the initial letter; the default is \code{"Mod"}.}
   \item{mu}{ optional integration (probability) measure for CvM MDE.
              defaults to \code{NULL} and is ignored in options
              \code{muDatOrMod} in \code{"Dat"} and \code{"Mod"};
@@ -191,21 +191,21 @@
 ## or
 KolmogorovMDEstimator(x = x, ParamFamily = G)
 
-## von Mises minimum distance estimator with default mu
+## von Mises minimum distance estimator with default mu = Mod
 MDEstimator(x = x, ParamFamily = G, distance = CvMDist)
 
 \donttest{
-## von Mises minimum distance estimator with default mu
+## von Mises minimum distance estimator with default mu = Mod
 MDEstimator(x = x, ParamFamily = G, distance = CvMDist,
             asvar.fct = .CvMMDCovarianceWithMux)
 ## or
 CvMMDEstimator(x = x, ParamFamily = G)
 ## or
+CvMMDEstimator(x = x, ParamFamily = G, muDatOrMod="Mod")
+
+## or with data based integration measure:
 CvMMDEstimator(x = x, ParamFamily = G, muDatOrMod="Dat")
 
-## or with model based integration measure:
-CvMMDEstimator(x = x, ParamFamily = G, muDatOrMod="Mod")
-
 ## von Mises minimum distance estimator with mu = N(0,1)
 MDEstimator(x = x, ParamFamily = G, distance = CvMDist, mu = Norm())
 ## or, with asy Var



More information about the Distr-commits mailing list