[Gmm-commits] r90 - in pkg/gmm: R data man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 16 19:54:18 CET 2015


Author: chaussep
Date: 2015-12-16 19:54:17 +0100 (Wed, 16 Dec 2015)
New Revision: 90

Modified:
   pkg/gmm/R/FinRes.R
   pkg/gmm/R/momentEstim.R
   pkg/gmm/R/sysGmm.R
   pkg/gmm/data/Growth.rda
   pkg/gmm/man/growth.Rd
Log:
add drop=FALSE in some sysGmm files

Modified: pkg/gmm/R/FinRes.R
===================================================================
--- pkg/gmm/R/FinRes.R	2015-11-18 20:25:53 UTC (rev 89)
+++ pkg/gmm/R/FinRes.R	2015-12-16 18:54:17 UTC (rev 90)
@@ -158,7 +158,7 @@
             dimnames(z$vcov) <- list(P$namesCoef[[1]], P$namesCoef[[1]])
         else
             dimnames(z$vcov) <- list(do.call(c, P$namesCoef), do.call(c, P$namesCoef))
-        z$call <- P$call        
+        z$call <- P$call
         if(is.null(P$weightsMatrix))
             {
                 if(P$wmatrix == "ident")
@@ -172,6 +172,8 @@
             } else {
                 z$w <- P$weightsMatrix
             }
+        for (i in 1:length(z$coefficients))
+            names(z$coefficients[[i]]) <- P$namesCoef[[i]]
         z$weightsMatrix <- P$weightsMatrix
         z$infVcov <- P$vcov
         z$infWmatrix <- P$wmatrix

Modified: pkg/gmm/R/momentEstim.R
===================================================================
--- pkg/gmm/R/momentEstim.R	2015-11-18 20:25:53 UTC (rev 89)
+++ pkg/gmm/R/momentEstim.R	2015-12-16 18:54:17 UTC (rev 90)
@@ -23,9 +23,9 @@
         y <- lapply(1:length(dat), function(i) dat[[i]]$x[,1])
         y <- do.call(c, y)
         z <- lapply(1:length(dat), function(i)
-            dat[[i]]$x[,(2+dat[[i]]$k):ncol(dat[[i]]$x)])
+            dat[[i]]$x[,(2+dat[[i]]$k):ncol(dat[[i]]$x), drop=FALSE])
         z <- .diagMatrix(z)
-        x <- lapply(1:length(dat), function(i) dat[[i]]$x[,2:(dat[[i]]$k+1)])
+        x <- lapply(1:length(dat), function(i) dat[[i]]$x[,2:(dat[[i]]$k+1), drop=FALSE])
         if (attr(dat, "sysInfo")$commonCoef)
             {
                 x <- do.call(rbind, x)
@@ -43,6 +43,7 @@
         tet0 <- .getThetaList(res0$par, dat)
         fsRes <- res0$fsRes
         w <- .weightFct_Sys(tet=tet0, dat=dat, type=object$vcov)
+        #return(list(w=w,tet0=tet0,dat=dat,dat2=dat2))
         res <- .tetlin(dat2, w)
         par <- .getThetaList(res$par, dat)
         names(par) <- names(dat)

Modified: pkg/gmm/R/sysGmm.R
===================================================================
--- pkg/gmm/R/sysGmm.R	2015-11-18 20:25:53 UTC (rev 89)
+++ pkg/gmm/R/sysGmm.R	2015-12-16 18:54:17 UTC (rev 90)
@@ -247,7 +247,7 @@
                 k <- attr(dat, "k")[[1]]
                 if (length(tet) != k)
                     stop("Wrong length of tet")
-                tet2 <- rep(list(tet), neq)
+                tet2 <- rep(list(c(tet)), neq)
             } else if (!is.null(attr(dat, "sysInfo")$crossEquConst)) { 
                 k <- attr(dat, "k")[[1]]
                 cst <- attr(dat, "sysInfo")$crossEquConst

Modified: pkg/gmm/data/Growth.rda
===================================================================
(Binary files differ)

Modified: pkg/gmm/man/growth.Rd
===================================================================
--- pkg/gmm/man/growth.Rd	2015-11-18 20:25:53 UTC (rev 89)
+++ pkg/gmm/man/growth.Rd	2015-12-16 18:54:17 UTC (rev 90)
@@ -20,6 +20,8 @@
   real GDP}
   \item{LagSavRate}{SavRate of the previous period}
   \item{Country}{Country names}
+  \item{Pop}{Population in thousands}
+  \item{LagPop}{Population of the previous period}
 }
 }
 



More information about the Gmm-commits mailing list