[Gmm-commits] r132 - in pkg/gmm4: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 17 22:58:43 CEST 2018


Author: chaussep
Date: 2018-09-17 22:58:42 +0200 (Mon, 17 Sep 2018)
New Revision: 132

Added:
   pkg/gmm4/R/gelfit-methods.R
   pkg/gmm4/man/gelfit-class.Rd
   pkg/gmm4/man/getImpProb-methods.Rd
Modified:
   pkg/gmm4/DESCRIPTION
   pkg/gmm4/NAMESPACE
   pkg/gmm4/R/allClasses.R
   pkg/gmm4/R/gelModels-methods.R
   pkg/gmm4/R/gmmModels-methods.R
   pkg/gmm4/man/coef-methods.Rd
   pkg/gmm4/man/evalDMoment-methods.Rd
   pkg/gmm4/man/modelFit-methods.Rd
   pkg/gmm4/man/print-methods.Rd
   pkg/gmm4/man/residuals-methods.Rd
   pkg/gmm4/man/show-methods.Rd
   pkg/gmm4/man/vcov-methods.Rd
Log:
add more stuff for GEL

Modified: pkg/gmm4/DESCRIPTION
===================================================================
--- pkg/gmm4/DESCRIPTION	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/DESCRIPTION	2018-09-17 20:58:42 UTC (rev 132)
@@ -16,6 +16,7 @@
         'rGmmModel-methods.R' 'hypothesisTest-methods.R'
         'sysGmmModel.R' 'sysGmmModels-methods.R' 'rsysGmmModels-methods.R'
 	'sgmmfit-methods.R' 'gmm4.R' 'gel.R' 'gelModels-methods.R'
+	'gelfit-methods.R'
 License: GPL (>= 2)
 NeedsCompilation: no
 VignetteBuilder: knitr

Modified: pkg/gmm4/NAMESPACE
===================================================================
--- pkg/gmm4/NAMESPACE	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/NAMESPACE	2018-09-17 20:58:42 UTC (rev 132)
@@ -22,7 +22,7 @@
               "numericORcharacter", "tsls", "rnonlinearGmm", "rfunctionGmm",
               "slinearGmm", "snonlinearGmm", "sysGmmModels",
               "sgmmfit","stsls", "rslinearGmm", "rsnonlinearGmm", "rsysGmmModels",
-              "formulaGmm","rfunctionGmm")
+              "formulaGmm","rfunctionGmm", "gelfit")
 exportMethods(residuals, print, show, vcovHAC, coef, vcov, bread, summary, update,
               model.matrix, hypothesisTest, "[", merge, subset)
 
@@ -31,7 +31,7 @@
        tsls, modelFit, meatGmm, specTest, gmm4, restGmmModel, modelResponse, DWH,
        modelDims, printRestrict, getRestrict, sysGmmModel, ThreeSLS, gelModel,
        rhoET, rhoEL, rhoEEL, rhoHD, EL.Wu, getLambda, gmmToGel, smoothGel,
-       solveGel)
+       solveGel, getImpProb)
  
 ###  S3 methods ###
 

Modified: pkg/gmm4/R/allClasses.R
===================================================================
--- pkg/gmm4/R/allClasses.R	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/R/allClasses.R	2018-09-17 20:58:42 UTC (rev 132)
@@ -87,6 +87,12 @@
 
 setClass("tsls", contains="gmmfit")
 
+## gelfit
+
+setClass("gelfit", representation(theta = "numeric", convergence = "numeric",
+                                  lambda = "numeric", lconvergence = "numeric",
+                                  call="call", type="character", model="gelModels"))
+
 ## specTest
 
 setClass("specTest", representation(test = "matrix", testname="character"))

Modified: pkg/gmm4/R/gelModels-methods.R
===================================================================
--- pkg/gmm4/R/gelModels-methods.R	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/R/gelModels-methods.R	2018-09-17 20:58:42 UTC (rev 132)
@@ -41,19 +41,26 @@
 
 ################ evalDMoment ##########################
 
-setMethod("evalDMoment", "gelModels", function(object, theta)
+setMethod("evalDMoment", "gelModels", function(object, theta, impProb=NULL)
     {
         if (object at vcov != "HAC")
             {
-                evalDMoment(as(object, "gmmModels"), theta)
+                evalDMoment(as(object, "gmmModels"), theta, impProb)
             } else {
-                f <- function(theta, object)
-                        colMeans(smoothGel(object, theta)$smoothx)
+                f <- function(theta, object, impProb)
+                    {
+                        gt <- evalMoment(object, theta)
+                        if (is.null(impProb))
+                            colMeans(gt)
+                        else
+                            colSums(gt*impProb)
+                    }
                 env <- new.env()
                 assign("theta", theta, envir = env)
                 assign("object", object, envir = env)
                 assign("f", f, envir = env)
-                G <- numericDeriv(quote(f(theta, object)), "theta", 
+                assign("impProb", impProb, envir=env)
+                G <- numericDeriv(quote(f(theta, object, impProb)), "theta", 
                                   env)
                 G <- attr(G, "gradient")
                 spec <- modelDims(object)
@@ -106,8 +113,9 @@
                       {
                           gt <- evalMoment(model, theta)
                           gelt <- model at gelType
+                          k <- model at wSpec$k
                           args <- c(list(gmat=gt, l0=lambda0, gelType=gelt$name,
-                                         rhoFct=gelt$fct), lcont)
+                                         rhoFct=gelt$fct), lcont, k=k[1]/k[2])
                           res <- do.call(slv, args)
                           if (returnL)
                               return(res)
@@ -137,4 +145,33 @@
           })
 
 
+#########################  modelFit  #########################
 
+setMethod("modelFit", signature("gelModels"), valueClass="gelfit", 
+          definition = function(object, gelType=NULL, rhoFct=NULL,
+              initTheta=c("gmm", "theta0"), start.tet=NULL,
+              start.lam=NULL, ...)
+              {
+                  Call <- match.call()
+                  initTheta = match.arg(initTheta)
+                  if (!is.null(gelType))
+                      object <- gmmToGel(as(object, "gmmModels"), gelType, rhoFct)
+                  if (is.null(start.tet))
+                      {
+                          if (initTheta == "gmm")
+                              start.tet <- modelFit(as(object, "gmmModels"))@theta
+                          else if ("theta0" %in% slotNames(object))
+                              start.tet <- object at theta0
+                          else
+                              stop("starting values is missing for the coefficient vector")
+                      }
+                  res <- solveGel(object, theta0=start.tet, lambda0=start.lam,
+                                  ...)
+                  
+                  new("gelfit", theta=res$theta, convergence=res$convergence,
+                      lconvergence=res$lconvergence$convergence,
+                      lambda=res$lambda, call=Call, type=object at gelType$name,
+                      model=object)
+                  })
+
+

Added: pkg/gmm4/R/gelfit-methods.R
===================================================================
--- pkg/gmm4/R/gelfit-methods.R	                        (rev 0)
+++ pkg/gmm4/R/gelfit-methods.R	2018-09-17 20:58:42 UTC (rev 132)
@@ -0,0 +1,104 @@
+####  All methods for gmmfit class
+#####################################
+                          
+
+## coef
+
+setMethod("coef", "gelfit", function(object) object at theta)
+
+## print
+
+setMethod("print", "gelfit",
+          function(x, model=TRUE, lambda=TRUE, ...) {
+              theta <- coef(x)
+              if (model)
+                  print(x at model)
+              type <- x at type
+              spec <- modelDims(x at model)
+              if (spec$q==spec$k && x at type != "eval")
+                  type <- paste("Just-Identified ", type, sep="")
+              cat("\nEstimation: ", type,"\n")
+              cat("Convergence Theta: ", x at convergence, "\n")
+              cat("Convergence Lambda: ", x at lconvergence, "\n")              
+              cat("coefficients:\n")
+              print.default(format(theta, ...), print.gap=2L, quote=FALSE)
+              if (lambda)
+                  {
+                      cat("lambdas:\n")
+                      print.default(format(x at lambda, ...), print.gap=2L, quote=FALSE)
+                  }
+          })
+
+## show
+
+setMethod("show","gelfit", function(object) print(object))
+
+## residuals
+
+setMethod("residuals", "gelfit", function(object) {
+    residuals(object at model, object at theta)})
+
+## getImpProb
+
+setGeneric("getImpProb", function(object, ...) standardGeneric("getImpProb"))
+
+setMethod("getImpProb", "gelfit",
+          function(object) {
+              rhoFct <- object at model@gelType
+              if (is.null(rhoFct$fct))
+                  rhoFct <- get(paste("rho", rhoFct$name, sep=""))
+              else
+                  rhoFct <- rhoFct$fct
+              gt <- evalMoment(object at model, object at theta)
+              k <- object at model@wSpec$k
+              pt <- -rhoFct(gt, object at lambda, 1, k[1]/k[2])/nrow(gt)
+              if (object at model@gelType$name == "EEL") {
+                  eps <- -length(pt) * min(min(pt), 0)
+                  pt <- (pt + eps/length(pt))/(1 + eps)
+              }
+              convMom <- colSums(pt * gt)
+              convProb <- abs(sum(as.numeric(pt))-1)
+              pt <- pt/sum(pt)
+              list(pt=pt, convMom=convMom, convProb=convProb)
+          })
+
+## vcov
+
+setMethod("vcov", "gelfit",
+          function(object, withImpProb=FALSE, tol=1e-10) {
+              spec <- modelDims(object at model)
+              q <- spec$q
+              gt <- evalMoment(object at model, object at theta)
+              n <- nrow(gt)
+              bw <- object at model@wSpec$bw
+              k <- object at model@wSpec$k
+              if (withImpProb)
+                  {
+                      pt <- getImpProb(object)$pt
+                      G <- evalDMoment(object at model, object at theta, pt)
+                      G <- G/k[1]
+                      gt <- gt * sqrt(pt * bw/k[2])
+                  } else {
+                      G <- evalDMoment(object at model, object at theta)
+                      G <- G/k[1]
+                      gt <- gt * sqrt(bw/k[2]/n)
+                  }
+              qrGt <- qr(gt)
+              piv <- sort.int(qrGt$pivot, index.return = TRUE)$ix
+              R <- qr.R(qrGt)[, piv]
+              X <- forwardsolve(t(R), G)
+              Y <- forwardsolve(t(R), diag(q))
+              res <- lm.fit(X, Y)
+              u <- res$residuals
+              Sigma <- chol2inv(res$qr$qr)/n
+              diag(Sigma)[diag(Sigma) < 0] <- tol
+              if (q == ncol(G)) {
+                  SigmaLam <- matrix(0, q, q)
+              } else {
+                  SigmaLam <- backsolve(R, u)/n * bw^2
+                  diag(SigmaLam)[diag(SigmaLam) < 0] <- tol
+              }
+              list(vcov_par = Sigma, vcov_lambda = SigmaLam)
+          })
+
+

Modified: pkg/gmm4/R/gmmModels-methods.R
===================================================================
--- pkg/gmm4/R/gmmModels-methods.R	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/R/gmmModels-methods.R	2018-09-17 20:58:42 UTC (rev 132)
@@ -241,30 +241,36 @@
 setGeneric("evalDMoment", function(object, ...) standardGeneric("evalDMoment"))
 
 setMethod("evalDMoment", signature("regGmm"),
-          function(object, theta) {
+          function(object, theta, impProb=NULL) {
               De <- Dresiduals(object, theta)
               Z <- model.matrix(object, "instrument")
-              G <- apply(De,2, function(x) colMeans(Z*x))
+              if (is.null(impProb))
+                  impProb <- 1/nrow(Z)
+              G <- apply(De,2, function(x) colSums(Z*x*impProb))
               d <- modelDims(object)
               dimnames(G) <- list(d$momNames, d$parNames)
               G
           })
 
 setMethod("evalDMoment", signature("functionGmm"),
-          function(object, theta) {
+          function(object, theta, impProb=NULL) {
               spec <- modelDims(object)
               if (is.null(spec$dfct))
               {
-                  f <- function(theta, object)
+                  f <- function(theta, object, impProb)
                   {
                       gt <- evalMoment(object, theta)
-                      colMeans(gt)
+                      if (is.null(impProb))
+                          colMeans(gt)
+                      else
+                          colSums(gt*impProb)
                   }
                   env <- new.env()
                   assign("theta", theta, envir=env)
                   assign("object", object, envir=env)
+                  assign("impProb", impProb, envir=env)
                   assign("f", f, envir=env)
-                  G <- numericDeriv(quote(f(theta, object)), "theta", env)
+                  G <- numericDeriv(quote(f(theta, object, impProb)), "theta", env)
                   G <- attr(G, "gradient")
               } else {
                   G <- spec$dfct(theta, object at X)
@@ -274,10 +280,12 @@
               })
 
 setMethod("evalDMoment", signature("formulaGmm"),
-          function(object, theta) {
+          function(object, theta, impProb=NULL) {
               res <- modelDims(object)
               nt <- names(theta)
               nt0 <- names(res$theta0)
+              if (is.null(impProb))
+                  impProb <- 1/modelDims(object)$n
               if (length(theta) != length(nt0))
                   stop("The length of theta is not equal to the number of parameters")
               if (is.null(nt))
@@ -290,15 +298,27 @@
                   {
                       lhs <- sapply(1:res$q, function(j) {
                           if (!is.null(res$fLHS[[j]]))
-                              d <- mean(eval(D(res$fLHS[[j]], i), varList))
-                          else
-                              d <- 0
+                              {
+                                  tmp <- eval(D(res$fLHS[[j]], i), varList)
+                                  if (length(tmp)>1)
+                                      d <- sum(tmp*impProb)
+                                  else
+                                      d <- tmp
+                              } else {
+                                  d <- 0
+                              }
                           c(d)})
                       rhs <- sapply(1:res$q, function(j) {
                           if (!is.null(res$fRHS[[j]]))
-                              d <- mean(eval(D(res$fRHS[[j]], i), varList))
-                          else
-                              d <- 0
+                              {
+                                  tmp <- eval(D(res$fRHS[[j]], i), varList)
+                                  if (length(tmp)>1)
+                                      d <- sum(tmp*impProb)
+                                  else
+                                      d <- tmp
+                              } else {
+                                  d <- 0
+                              }
                           c(d)})
                       G <- cbind(G, lhs-rhs)
                   }

Modified: pkg/gmm4/man/coef-methods.Rd
===================================================================
--- pkg/gmm4/man/coef-methods.Rd	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/man/coef-methods.Rd	2018-09-17 20:58:42 UTC (rev 132)
@@ -2,6 +2,7 @@
 \docType{methods}
 \alias{coef-methods}
 \alias{coef,gmmfit-method}
+\alias{coef,gelfit-method}
 \alias{coef,sgmmfit-method}
 \alias{coef,rlinearGmm-method}
 \alias{coef,rslinearGmm-method}
@@ -19,6 +20,9 @@
 \item{\code{signature(object = "gmmfit")}}{
 }
 
+\item{\code{signature(object = "gelfit")}}{
+}
+
 \item{\code{signature(object = "sgmmfit")}}{
 }
 

Modified: pkg/gmm4/man/evalDMoment-methods.Rd
===================================================================
--- pkg/gmm4/man/evalDMoment-methods.Rd	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/man/evalDMoment-methods.Rd	2018-09-17 20:58:42 UTC (rev 132)
@@ -8,7 +8,7 @@
 \alias{evalDMoment,sysGmmModels-method}
 \alias{evalDMoment,rslinearGmm-method}
 \alias{evalDMoment,regGmm-method}
-\title{ ~~ Methods for Function \code{evalDMoment} in Package \pkg{Gmm} ~~}
+\title{ ~~ Methods for Function \code{evalDMoment} in Package \pkg{gmm4} ~~}
 \description{
 It computes the matrix of derivatives of the sample moments with respect
 to the coefficients.

Added: pkg/gmm4/man/gelfit-class.Rd
===================================================================
--- pkg/gmm4/man/gelfit-class.Rd	                        (rev 0)
+++ pkg/gmm4/man/gelfit-class.Rd	2018-09-17 20:58:42 UTC (rev 132)
@@ -0,0 +1,31 @@
+\name{gelfit-class}
+\docType{class}
+\alias{gelfit-class}
+
+\title{Class \code{"gelfit"}}
+\description{
+The main object that contains all information about the GEL fit.
+}
+\section{Objects from the Class}{
+Objects can be created by calls of the form \code{new("gelfit", ...)}
+but can be created with \code{\link{modelFit}}.
+}
+\section{Slots}{
+  \describe{
+    \item{\code{theta}:}{Object of class \code{"numeric"} ~~ }
+    \item{\code{convergence}:}{Object of class \code{"numeric"} ~~ }
+    \item{\code{lambda}:}{Object of class \code{"numeric"} ~~ }
+    \item{\code{lconvergence}:}{Object of class \code{"numeric"} ~~ }
+    \item{\code{call}:}{Object of class \code{"call"} ~~ }
+    \item{\code{type}:}{Object of class \code{"character"} ~~ }
+    \item{\code{model}:}{Object of class \code{"gelModels"} ~~ }
+  }
+}
+
+\seealso{
+\code{\link{modelFit}}
+}
+\examples{
+showClass("gelfit")
+}
+\keyword{classes}

Added: pkg/gmm4/man/getImpProb-methods.Rd
===================================================================
--- pkg/gmm4/man/getImpProb-methods.Rd	                        (rev 0)
+++ pkg/gmm4/man/getImpProb-methods.Rd	2018-09-17 20:58:42 UTC (rev 132)
@@ -0,0 +1,17 @@
+\name{getImpProb-methods}
+\docType{methods}
+\alias{getImpProb}
+\alias{getImpProb,gelfit-method}
+\title{ ~~ Methods for Function \code{getImpProb} in Package \pkg{gmm4} ~~}
+\description{
+Method to evaluate the implied probabilities of GEL.
+}
+\section{Methods}{
+\describe{
+
+\item{\code{signature(object = "gelfit")}}{
+}
+
+}}
+
+\keyword{probabilities}

Modified: pkg/gmm4/man/modelFit-methods.Rd
===================================================================
--- pkg/gmm4/man/modelFit-methods.Rd	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/man/modelFit-methods.Rd	2018-09-17 20:58:42 UTC (rev 132)
@@ -3,6 +3,7 @@
 \alias{modelFit}
 \alias{modelFit-methods}
 \alias{modelFit,gmmModels-method}
+\alias{modelFit,gelModels-method}
 \alias{modelFit,formulaGmm-method}
 \alias{modelFit,sysGmmModels-method}
 \alias{modelFit,rlinearGmm-method}
@@ -48,6 +49,10 @@
               "onestep"), itertol=1e-7, initW=c("ident", "tsls", "EbyE"),
               weights="optimal", itermaxit=100,
               efficientWeights=FALSE, start=NULL, EbyE=FALSE, \dots)
+
+\S4method{modelFit}{gelModels}(object, gelType=NULL, rhoFct=NULL,
+              initTheta=c("gmm", "theta0"), start.tet=NULL,
+              start.lam=NULL, ...)
 }
 \arguments{
   \item{object}{An object of class \code{"gmmModels"}}
@@ -78,7 +83,20 @@
     the model is nonlinear. By default, the theta0 argument of the model
     is used}
   \item{EbyE}{Should we estimate the system equation by equation?}
-  \item{\dots}{Arguments to pass to other methods}
+  \item{\dots}{Arguments to pass to other methods (mostly the
+    optimization algorithm)}
+  \item{gelType}{The type of GEL. This argument is only used if we want
+              to fit the model with a different GEL method. see \code{\link{gelModel}}.}
+  \item{rhoFct}{An alternative objective function for GEL. This argument
+    is only used if we want to fit the model with a different GEL
+    method. see \code{\link{gelModel}}.}
+  \item{initTheta}{Method to obtain the starting values for the
+    coefficient vector. By default the GMM estimate with identity matrix
+    is used. The second argument means that the theta0 of the
+    object, if any, should be used.}
+  \item{start.tet}{Manual starting values for the coeffficient vector.}
+  \item{start.lam}{Manual starting values for the Lagrange
+              multiplier. By default, it is a vector of zeros.}
   }
 \section{Methods}{
 \describe{
@@ -86,6 +104,10 @@
 The main method for all GMM-type models.
 }
 
+\item{\code{signature(object = "gelModels")}}{
+The main method for all GEL-type models.
+}
+
 \item{\code{signature(object = "rnonlinearGmm")}}{
 It makes a difference only if the number of contraints is equal to the
 number of coefficients, in which case, the method \code{\link{evalGmm}}

Modified: pkg/gmm4/man/print-methods.Rd
===================================================================
--- pkg/gmm4/man/print-methods.Rd	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/man/print-methods.Rd	2018-09-17 20:58:42 UTC (rev 132)
@@ -5,6 +5,7 @@
 \alias{print,gmmModels-method}
 \alias{print,gelModels-method}
 \alias{print,gmmfit-method}
+\alias{print,gelfit-method}
 \alias{print,sgmmfit-method}
 \alias{print,rlinearGmm-method}
 \alias{print,rslinearGmm-method}
@@ -39,6 +40,8 @@
 }
 \item{\code{signature(x = "gmmfit")}}{
 }
+\item{\code{signature(x = "gelfit")}}{
+}
 \item{\code{signature(x = "sgmmfit")}}{
 }
 \item{\code{signature(x = "summaryGmm")}}{

Modified: pkg/gmm4/man/residuals-methods.Rd
===================================================================
--- pkg/gmm4/man/residuals-methods.Rd	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/man/residuals-methods.Rd	2018-09-17 20:58:42 UTC (rev 132)
@@ -7,6 +7,7 @@
 \alias{residuals,nonlinearGmm-method}
 \alias{residuals,sysGmmModels-method}
 \alias{residuals,gmmfit-method}
+\alias{residuals,gelfit-method}
 \alias{residuals,sgmmfit-method}
 \title{ ~~ Methods for Function \code{residuals} in Package \pkg{stats} ~~}
 \description{
@@ -28,6 +29,8 @@
 
 \item{\code{signature(object = "gmmfit")}}{
 }
+\item{\code{signature(object = "gelfit")}}{
+}
 \item{\code{signature(object = "sgmmfit")}}{
 }
 \item{\code{signature(object = "sysGmmModels")}}{

Modified: pkg/gmm4/man/show-methods.Rd
===================================================================
--- pkg/gmm4/man/show-methods.Rd	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/man/show-methods.Rd	2018-09-17 20:58:42 UTC (rev 132)
@@ -5,6 +5,7 @@
 \alias{show,gmmModels-method}
 \alias{show,sysGmmModels-method}
 \alias{show,gmmfit-method}
+\alias{show,gelfit-method}
 \alias{show,sgmmfit-method}
 \alias{show,specTest-method}
 \alias{show,summaryGmm-method}
@@ -30,6 +31,8 @@
 
 \item{\code{signature(object = "gmmfit")}}{
 }
+\item{\code{signature(object = "gelfit")}}{
+}
 \item{\code{signature(object = "sgmmfit")}}{
 }
 \item{\code{signature(object = "specTest")}}{

Modified: pkg/gmm4/man/vcov-methods.Rd
===================================================================
--- pkg/gmm4/man/vcov-methods.Rd	2018-09-14 20:53:53 UTC (rev 131)
+++ pkg/gmm4/man/vcov-methods.Rd	2018-09-17 20:58:42 UTC (rev 132)
@@ -2,11 +2,12 @@
 \docType{methods}
 \alias{vcov-methods}
 \alias{vcov,gmmfit-method}
+\alias{vcov,gelfit-method}
 \alias{vcov,sgmmfit-method}
 \alias{vcov,tsls-method}
 \title{ ~~ Methods for Function \code{vcov} in Package \pkg{stats} ~~}
 \description{
-Computes the covariance matrix of the coefficient estimated by GMM. 
+Computes the covariance matrix of the coefficient estimated by GMM or GEL. 
 }
 \usage{
 \S4method{vcov}{gmmfit}(object, sandwich=NULL, df.adj=FALSE,
@@ -17,6 +18,7 @@
 
 \S4method{vcov}{tsls}(object, sandwich=TRUE, df.adj=FALSE)
 
+\S4method{vcov}{gelfit}(object, withImpProb=FALSE, tol=1e-10)
 }
 \arguments{
   \item{object}{An object of class \code{"gmmfit"}}
@@ -37,6 +39,9 @@
     to change the way the variance of the moments is computed. If it is
     set to a different specification included in the model,
     \code{sandwich} is set to \code{TRUE}. }
+  \item{withImpProb}{Should we compute the moments with the implied
+    probabilities}
+  \item{tol}{Any diagonal less than \code{"tol"} is set to tol}
 }
 \section{Methods}{
 \describe{
@@ -45,6 +50,10 @@
 For any model estimated by any GMM methods.  
 }
 
+\item{\code{signature(object = "gelfit")}}{
+For any model estimated by any GMM methods.  
+}
+
 \item{\code{signature(object = "sgmmfit")}}{
 For any system of equations estimated by any GMM methods.  
 }



More information about the Gmm-commits mailing list