[Gmm-commits] r83 - in pkg/gmm: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Oct 27 22:37:13 CET 2015


Author: chaussep
Date: 2015-10-27 22:37:12 +0100 (Tue, 27 Oct 2015)
New Revision: 83

Modified:
   pkg/gmm/NEWS
   pkg/gmm/R/gmm.R
Log:
See News

Modified: pkg/gmm/NEWS
===================================================================
--- pkg/gmm/NEWS	2015-10-27 20:55:24 UTC (rev 82)
+++ pkg/gmm/NEWS	2015-10-27 21:37:12 UTC (rev 83)
@@ -11,7 +11,9 @@
 o It is no possible to provide gmm with the gradiant function when constrOptim is used.
 o There is now an evalGmm() function to create a gmm object with a given fixed vector. Not estimation is done, but the bandwidth and weights
   for the HAC estimator are generated. It is possible to give a different vector os parameters for the moment function and the weighting matrix.
+o There is also an evalGel(). You fix the parameters and only the lambda are computed.
 o Fixed NAMESPACE to avoid the notes given by CRAN.
+o Modified getDat to allow for ~1 as instruments. Useful for inference on the mean using empirical likelihood.
 
 Changes in version 1.5-2
 

Modified: pkg/gmm/R/gmm.R
===================================================================
--- pkg/gmm/R/gmm.R	2015-10-27 20:55:24 UTC (rev 82)
+++ pkg/gmm/R/gmm.R	2015-10-27 21:37:12 UTC (rev 83)
@@ -124,6 +124,9 @@
 	mf[[1L]] <- as.name("model.frame")
 	mf <- eval(mf, parent.frame())
 	mt <- attr(mf, "terms")
+	y <- as.matrix(model.response(mf, "numeric"))
+	xt <- as.matrix(model.matrix(mt, mf, NULL))
+        n <- NROW(y)
 
 	if (inherits(h,'formula'))
 		{
@@ -138,6 +141,11 @@
 		mfh <- eval(mfh, parent.frame())
 		mth <- attr(mfh, "terms")
 		h <- as.matrix(model.matrix(mth, mfh, NULL))
+                if (length(h) == 0)
+                    {
+                        h <- as.matrix(rep(1,n))
+                        colnames(h) <- "h.(Intercept)"
+                    }                
 		}
 	else
 		{		
@@ -155,8 +163,6 @@
 			h <- as.matrix(h[,2:ncol(h)])
 			}
 		}
-	y <- as.matrix(model.response(mf, "numeric"))
-	xt <- as.matrix(model.matrix(mt, mf, NULL))
 	ny <- ncol(y)
 	k <- ncol(xt)
 	nh <- ncol(h)



More information about the Gmm-commits mailing list