[Gmm-commits] r174 - in pkg: causalGel/R momentfit/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 3 22:28:19 CET 2020


Author: chaussep
Date: 2020-11-03 22:28:19 +0100 (Tue, 03 Nov 2020)
New Revision: 174

Modified:
   pkg/causalGel/R/causalGel.R
   pkg/causalGel/R/causalMethods.R
   pkg/momentfit/R/momentModel-methods.R
Log:
fixed another bug

Modified: pkg/causalGel/R/causalGel.R
===================================================================
--- pkg/causalGel/R/causalGel.R	2020-11-03 20:17:06 UTC (rev 173)
+++ pkg/causalGel/R/causalGel.R	2020-11-03 21:28:19 UTC (rev 174)
@@ -6,9 +6,7 @@
 {
     momType <- match.arg(momType)
     if (!is.null(popMom))
-        {
-            momType <- "fixedMom"
-        }
+        momType <- "fixedMom"
     tmp_model <- momentfit:::.lModelData(g, balm, data)
     if (attr(terms(tmp_model$modelF), "intercept") != 1)
         stop("You cannot remove the intercept from g")
@@ -111,7 +109,8 @@
         if (!is.null(theta0)) 
             theta0 <- theta0[(names(theta0) %in% spec$parNames)]
     }    
-    fit <- gelFit(model=model, gelType=gelType, rhoFct=rhoFct, initTheta=initTheta, theta0=theta0,
+    fit <- gelFit(model=model, gelType=gelType, rhoFct=rhoFct,
+                  initTheta=initTheta, theta0=theta0,
                   lambda0=lambda0, vcov=getVcov, coefSlv=coefSlv,
                   lamSlv=lamSlv, tControl=tControl, lControl=lControl)
     fit at call <- Call

Modified: pkg/causalGel/R/causalMethods.R
===================================================================
--- pkg/causalGel/R/causalMethods.R	2020-11-03 20:17:06 UTC (rev 173)
+++ pkg/causalGel/R/causalMethods.R	2020-11-03 21:28:19 UTC (rev 174)
@@ -39,10 +39,10 @@
               G[(k+1):ntet, (k+1):ntet] <- -sum(impProb)*diag(k-1)
               uK <- colSums(impProb*X[,-1,drop=FALSE])
               G[(2*k):q, (k+1):ntet] <- -kronecker(diag(k-1), uK)
-              if (!(dat at momType %in% c("uncondBal", "fixedMom")))
+              if (dat at momType != "uncondBal")
               {
                       G <- rbind(G, matrix(0, ncol(X)-1, ntet))
-                      if (augmented)
+                      if (augmented & dat at momType != "fixedMom")
                       {
                           ncov <- length(object at X@balCov)
                           q <- nrow(G)- ncov

Modified: pkg/momentfit/R/momentModel-methods.R
===================================================================
--- pkg/momentfit/R/momentModel-methods.R	2020-11-03 20:17:06 UTC (rev 173)
+++ pkg/momentfit/R/momentModel-methods.R	2020-11-03 21:28:19 UTC (rev 174)
@@ -660,7 +660,7 @@
 
 setMethod("solveGmm", signature("allNLModel", "momentWeights"),
           function(object, wObj, theta0=NULL, algo=c("optim","nlminb"), ...)
-              {
+          {
                   algo <- match.arg(algo)
                   if (is.null(theta0))
                       theta0 <- modelDims(object)$theta0



More information about the Gmm-commits mailing list