[Gmm-commits] r155 - in pkg: causalGel/R gmm4/R gmm4/vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 19 23:10:53 CET 2019


Author: chaussep
Date: 2019-11-19 23:10:53 +0100 (Tue, 19 Nov 2019)
New Revision: 155

Modified:
   pkg/causalGel/R/causalMethods.R
   pkg/gmm4/R/gelfit-methods.R
   pkg/gmm4/vignettes/gelS4.pdf
Log:
fixed small bugs

Modified: pkg/causalGel/R/causalMethods.R
===================================================================
--- pkg/causalGel/R/causalMethods.R	2019-11-19 20:10:23 UTC (rev 154)
+++ pkg/causalGel/R/causalMethods.R	2019-11-19 22:10:53 UTC (rev 155)
@@ -97,8 +97,12 @@
                                 initTheta=c("gmm", "theta0"), start.tet=NULL,
                                 start.lam=NULL, vcov=FALSE, ...)
           {
+              Call <- try(match.call(call=sys.call(sys.parent())), silent=TRUE)
+              if (class(Call)=="try-error")
+                  Call <- NULL              
               res <- callNextMethod()
-              new("causalGelfit", res)
+              res at call <- Call
+              obj <- new("causalGelfit", res)
           })
 
 ## model.matrix and modelResponse

Modified: pkg/gmm4/R/gelfit-methods.R
===================================================================
--- pkg/gmm4/R/gelfit-methods.R	2019-11-19 20:10:23 UTC (rev 154)
+++ pkg/gmm4/R/gelfit-methods.R	2019-11-19 22:10:53 UTC (rev 155)
@@ -559,6 +559,8 @@
                   stop("No call argument")
               arg <- list(...)
               ev <- new.env(parent.frame())
+              theta0 <- arg$theta0
+              
               if (object at call[[1]] != "gel4")
               {
                   model <- if(is.null(newModel))
@@ -571,6 +573,16 @@
                   arg <- arg[which(is.na(match(names(arg),
                                                c("rhoFct", slotNames(model)))))]
               }
+              spec <- modelDims(model)
+              if (!is.null(call[["theta0"]]))
+              {
+                  call[["theta0"]] <- if (is.null(theta0))
+                                          spec$theta0
+                                      else
+                                          theta0
+              } else if (!is.null(theta0)) {
+                  call[["theta0"]] <- theta0
+              }
               if (length(arg) > 0) 
                   for (n in names(arg)) call[[n]] <- arg[[n]]
               if (evaluate)

Modified: pkg/gmm4/vignettes/gelS4.pdf
===================================================================
(Binary files differ)



More information about the Gmm-commits mailing list