[Distr-commits] r395 - branches/distr-2.1/pkg/distrMod/R branches/distr-2.1/pkg/distrMod/chm pkg/distrMod/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 6 21:53:24 CET 2009


Author: ruckdeschel
Date: 2009-02-06 21:53:24 +0100 (Fri, 06 Feb 2009)
New Revision: 395

Modified:
   branches/distr-2.1/pkg/distrMod/R/L2GroupFamilies.R
   branches/distr-2.1/pkg/distrMod/chm/distrMod.chm
   pkg/distrMod/R/L2GroupFamilies.R
Log:
fixed a bug in L2GroupFamilies:
it must be .getLogDeriv(centraldistribution) instead of .getLogDeriv(distribution)

Modified: branches/distr-2.1/pkg/distrMod/R/L2GroupFamilies.R
===================================================================
--- branches/distr-2.1/pkg/distrMod/R/L2GroupFamilies.R	2009-02-06 18:41:22 UTC (rev 394)
+++ branches/distr-2.1/pkg/distrMod/R/L2GroupFamilies.R	2009-02-06 20:53:24 UTC (rev 395)
@@ -38,7 +38,7 @@
     props <- c(paste("The", name, "is invariant under"),
                "the group of transformations 'g(x) = x + loc'",
                "with location parameter 'loc'")
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    loc <- main(param)
                    fct <- function(x){}
@@ -181,7 +181,7 @@
     props <- c(paste("The", name, "is invariant under"),
                "the group of transformations 'g(y) = scale*y'",
                "with scale parameter 'scale'")
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    scale <- main(param)
                    fct <- function(x){}
@@ -334,7 +334,7 @@
                "the group of transformations 'g(x) = scale*x + loc'",
                "with location parameter 'loc' and scale parameter 'scale'")
 
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    mean <- main(param)[locscalename["loc"]]
                    sd <-   main(param)[locscalename["scale"]]
@@ -501,7 +501,7 @@
                "the group of transformations 'g(x) = scale*x + loc'",
                "with location parameter 'loc' and scale parameter 'scale'")
 
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    mean <- main(param)
                    sd <-   nuisance(param)
@@ -667,7 +667,7 @@
                "the group of transformations 'g(x) = scale*x + loc'",
                "with location parameter 'loc' and scale parameter 'scale'")
 
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    mean <- nuisance(param)
                    sd <-   main(param)

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

Modified: pkg/distrMod/R/L2GroupFamilies.R
===================================================================
--- pkg/distrMod/R/L2GroupFamilies.R	2009-02-06 18:41:22 UTC (rev 394)
+++ pkg/distrMod/R/L2GroupFamilies.R	2009-02-06 20:53:24 UTC (rev 395)
@@ -38,7 +38,7 @@
     props <- c(paste("The", name, "is invariant under"),
                "the group of transformations 'g(x) = x + loc'",
                "with location parameter 'loc'")
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    loc <- main(param)
                    fct <- function(x){}
@@ -181,7 +181,7 @@
     props <- c(paste("The", name, "is invariant under"),
                "the group of transformations 'g(y) = scale*y'",
                "with scale parameter 'scale'")
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    scale <- main(param)
                    fct <- function(x){}
@@ -309,6 +309,9 @@
         }
     }
 
+    mad.const <- 1/ if (is(distrSymm, "NoSymmetry")) 
+                        mad(centraldistribution) else q(centraldistribution)(.75)
+    
     param0 <- c(loc, scale)
     names(param0) <- locscalename
     if(missing(trafo))  {trafo <- diag(2)
@@ -316,8 +319,9 @@
                                                  locscalename)}
     param <- ParamFamParameter(name = "location and scale", main = param0,
                                trafo = trafo)
+    
     startPar <- function(x,...) {
-                   st <- c(median(x),mad(x))
+                   st <- c(median(x),mad(x, constant=mad.const))
                    names(st) <- locscalename
                    return(st)}
     makeOKPar <- function(param) {
@@ -330,7 +334,7 @@
                "the group of transformations 'g(x) = scale*x + loc'",
                "with location parameter 'loc' and scale parameter 'scale'")
 
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    mean <- main(param)[locscalename["loc"]]
                    sd <-   main(param)[locscalename["scale"]]
@@ -497,7 +501,7 @@
                "the group of transformations 'g(x) = scale*x + loc'",
                "with location parameter 'loc' and scale parameter 'scale'")
 
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    mean <- main(param)
                    sd <-   nuisance(param)
@@ -663,7 +667,7 @@
                "the group of transformations 'g(x) = scale*x + loc'",
                "with location parameter 'loc' and scale parameter 'scale'")
 
-    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(distribution)
+    if(missing(LogDeriv)) LogDeriv <- .getLogDeriv(centraldistribution)
     L2deriv.fct <- function(param){
                    mean <- nuisance(param)
                    sd <-   main(param)



More information about the Distr-commits mailing list