[Distr-commits] r256 - branches/distr-2.0/pkg/distrMod/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 10 18:29:20 CEST 2008


Author: stamats
Date: 2008-08-10 18:29:19 +0200 (Sun, 10 Aug 2008)
New Revision: 256

Modified:
   branches/distr-2.0/pkg/distrMod/R/SimpleL2ParamFamilies.R
   branches/distr-2.0/pkg/distrMod/R/modifyModel.R
Log:
some minor corrections/modifications

Modified: branches/distr-2.0/pkg/distrMod/R/SimpleL2ParamFamilies.R
===================================================================
--- branches/distr-2.0/pkg/distrMod/R/SimpleL2ParamFamilies.R	2008-08-08 17:44:10 UTC (rev 255)
+++ branches/distr-2.0/pkg/distrMod/R/SimpleL2ParamFamilies.R	2008-08-10 16:29:19 UTC (rev 256)
@@ -489,6 +489,7 @@
     res <- L2ScaleFamily(loc = mean, scale = sd, name = "normal scale family",
                   locscalename = c("loc"="mean", "scale"="sd"), 
                   modParam = modParam, 
+                  LogDeriv = function(x) x,
                   L2derivDistr.0 = (Chisq(df = 1, ncp = 0)-1)/sd,
                   distrSymm = SphericalSymmetry(SymmCenter = mean),
                   L2derivSymm = FunSymmList(EvenSymmetric(SymmCenter = mean)),
@@ -514,6 +515,7 @@
               name = "normal location and scale family", 
               locscalename = c("loc"="mean", "scale"="sd"), 
               modParam = function(theta) Norm(mean = theta[1], sd = theta[2]),
+              LogDeriv = function(x) x,
               L2derivDistr.0 = list( Norm(mean = 0, sd=1/sd), 
                                     (Chisq(df = 1, ncp = 0)-1)/sd),
               FisherInfo.0 = matrix(c(1,0,0,2),2,2, 
@@ -665,6 +667,7 @@
                      name = "normal location family with unknown scale (as nuisance)",
                      locscalename = c("loc"="mean", "scale"="sd"), 
                      modParam = function(theta) Norm(mean = theta[1], sd = theta[2]),
+                     LogDeriv = function(x) x,
                      L2derivDistr.0 = list( Norm(mean = 0, sd=1/sd), 
                                     (Chisq(df = 1, ncp = 0)-1)/sd),
                      FisherInfo.0 = matrix(c(1,0,0,2),2,2, 
@@ -694,6 +697,7 @@
                   name = "normal scale family with unknown location (as nuisance)", 
                   locscalename = c("loc"="mean", "scale"="sd"), 
                   modParam = function(theta) Norm(mean = theta[2], sd = theta[1]),
+                  LogDeriv = function(x) x,
                   L2derivDistr.0 = list( Norm(mean = 0, sd=1/sd), 
                                        (Chisq(df = 1, ncp = 0)-1)/sd),
                   FisherInfo.0 = matrix(c(1,0,0,2),2,2, 

Modified: branches/distr-2.0/pkg/distrMod/R/modifyModel.R
===================================================================
--- branches/distr-2.0/pkg/distrMod/R/modifyModel.R	2008-08-08 17:44:10 UTC (rev 255)
+++ branches/distr-2.0/pkg/distrMod/R/modifyModel.R	2008-08-10 16:29:19 UTC (rev 256)
@@ -140,9 +140,19 @@
              cl <- model at fam.call
              M <- modifyModel(as(model, "L2ParamFamily"), param = param,
                               .withCall = FALSE)
-             param0 <- c(main(param(M)),nuisance(param(M)))
-             scale <- param0["scale"]
-             loc <- median(distribution(M))
+             param0 <- c(main(param),nuisance(param))
+             if(!length(nuisance(param))){
+                loc <- main(param)[1]
+                scale <- main(param)[2]
+             }else{
+                if(names(nuisance(param)) == "loc"){
+                    loc <- nuisance(param)
+                    scale <- main(param)
+                }else{
+                    loc <- main(param)
+                    scale <- nuisance(param)
+                }
+             }
              M at distrSymm <- SphericalSymmetry(SymmCenter = loc)
              M at L2derivSymm <- FunSymmList(OddSymmetric(SymmCenter = loc),
                                           EvenSymmetric(SymmCenter = loc))



More information about the Distr-commits mailing list