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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 24 05:18:08 CEST 2012


Author: chaussep
Date: 2012-05-24 05:18:08 +0200 (Thu, 24 May 2012)
New Revision: 55

Modified:
   pkg/gmm/NEWS
   pkg/gmm/R/Methods.gel.R
   pkg/gmm/R/gel.R
   pkg/gmm/R/getModel.R
   pkg/gmm/R/gmmTests.R
   pkg/gmm/R/momentEstim.R
   pkg/gmm/man/gel.Rd
   pkg/gmm/man/getLamb.Rd
Log:
CGEL is added and a bug with gmm-cue has been fixed. See NEWS and help(gel)

Modified: pkg/gmm/NEWS
===================================================================
--- pkg/gmm/NEWS	2012-04-30 20:51:09 UTC (rev 54)
+++ pkg/gmm/NEWS	2012-05-24 03:18:08 UTC (rev 55)
@@ -22,7 +22,7 @@
 o The choice "iter" from the option optlam is kept for cases in which the optimizer fails to solve for lambda. It is often the case 
   when type="ETEL" is chosen which tends to produce NA's.
 o For GEL of type "EL" and optfct="optim", the algorith constrOptim() is launched to make sure lambda'gt is always greater than 1
-  and avoid NA's when computing log(1-lambda'gt).
+  and avoid NA's when computing log(1-lambda'gt). The algorithm checks first with optim(), and swith to constrOptim() is optim() fails 
 o Sometimes, problems happen in GMM estimation because of the bad first step estimates used to compute the weighting matrix.
   The first step estimates are usually computed using the identity matrix. The vector is now printed for better control. 
 o Cleaned the codes. The data are in object$dat and we can get the moment matrix by calling gt <- object$g(object$coef,object$dat) for linear and 
@@ -32,8 +32,11 @@
 o (gmm only) The bandwidth for the HAC estimation is set by the first step estimate. Its value, along with the weights, 
   is saved in attr(obj$w0,"Spec"). If the user is not satisfied with this automatic bw selection, bw can be set to any fixed number when
   calling gmm(). See ?gmm for more details and examples.
-o The function gmmWithConst() reestimate an unrestricted model by imposing linear constraints, using the same specification. It also use the same bandwidth for
-  the estimation os the HAC matrix
+o The function gmmWithConst() reestimate an unrestricted model by imposing linear constraints, using the same specification. 
+  It also use the same bandwidth for the estimation of the HAC matrix
+o A regularized version of GEL based on Chausse(2011) is now implemented. The Lagrange multiplier can be regularized by setting the option
+  "alpha=" to a number. The regularization can stabilize the GEL estimator. A preliminary paper will be available on my web site that analyze 
+  the properties of such modification.  A method for selecting alpha will be implemented in future version.   
 
 Changes in version 1.3-8
 

Modified: pkg/gmm/R/Methods.gel.R
===================================================================
--- pkg/gmm/R/Methods.gel.R	2012-04-30 20:51:09 UTC (rev 54)
+++ pkg/gmm/R/Methods.gel.R	2012-05-24 03:18:08 UTC (rev 55)
@@ -60,7 +60,11 @@
 
 print.gel <- function(x, digits = 5, ...)
 	{
-	cat("Type de GEL: ", x$type, "\n\n")
+	if (is.null(x$CGEL))
+		cat("Type de GEL: ", x$type, "\n\n")
+	else
+		cat("CGEL of type: ", x$type, " (alpha = ", x$CGEL, ")\n\n")
+
 	cat("Coefficients:\n")
 	print.default(format(coef(x), digits = digits),
                       print.gap = 2, quote = FALSE)
@@ -78,7 +82,10 @@
 	{
 	cat("\nCall:\n")
 	cat(paste(deparse(x$call), sep = "\n", collapse = "\n"), "\n\n", sep = "")
-	cat("\nType of GEL: ", x$type, "\n\n")
+	if (is.null(x$CGEL))
+		cat("Type de GEL: ", x$type, "\n\n")
+	else
+		cat("CGEL of type: ", x$type, " (alpha = ", x$CGEL, ")\n\n")
 	cat("Kernel: ", x$kernel, "\n\n")
 	cat("Coefficients:\n")
 	print.default(format(x$coefficients, digits = digits),
@@ -133,6 +140,7 @@
 	ans$conv_pt <- z$conv_pt
 	ans$conv_moment <- cbind(z$conv_moment)
 	ans$conv_lambda <- z$conv_lambda
+	ans$CGEL <- z$CGEL
 	names(ans$conv_pt) <- "Sum_of_pt"
 	dimnames(ans$conv_moment) <- list(names(z$gt), "Sample_moment_with_pt")
 	class(ans) <- "summary.gel"

Modified: pkg/gmm/R/gel.R
===================================================================
--- pkg/gmm/R/gel.R	2012-04-30 20:51:09 UTC (rev 54)
+++ pkg/gmm/R/gel.R	2012-05-24 03:18:08 UTC (rev 55)
@@ -53,14 +53,49 @@
 	return(c(rhomat))
 	}
 
+.getCgelLam <- function(gt, l0, type = c('EL', 'ET', 'CUE'), method = c("nlminb", "optim", "constrOptim"), control=list(), k = 1, alpha = 0.01)
+	{
+	type <- match.arg(type)
+	method <- match.arg(method)
+	fct <- function(l, X)
+		{
+		r1 <- colMeans(.rho(gt,l,derive=1,type=type,k=k)*X)
+		crossprod(r1) + alpha*crossprod(l)
+		}
+	Dfct <- function(l, X)
+		{
+		r2 <- .rho(X,l,derive=2,type=type,k=k)
+		r1 <- .rho(X,l,derive=1,type=type,k=k)
+		H <- t(X*r2)%*%X/nrow(X)
+		2*H%*%colMeans(r1*X) + 2*alpha*l
+		}
 
-getLamb <- function(gt, type = c('EL', 'ET', 'CUE', "ETEL"), tol_lam = 1e-7, maxiterlam = 100, tol_obj = 1e-7, 
+	if (method == "nlminb")
+		res <- nlminb(l0, fct, Dfct, X = gt, control = control) 
+	if (method == "optim")
+		res <- optim(l0, fct, Dfct, X = gt, method="BFGS", control = control) 
+	if (method == "constrOptim")
+		{
+		ci <- -rep(1,nrow(gt))
+		res <- constrOptim(rep(0,ncol(gt)),fct,Dfct,-gt,ci,control=control,X=gt)
+		}
+	if (method == "optim")
+		{
+		conv <- list(convergence = res$convergence, counts = res$counts, message = res$message)
+	} else {
+		conv <- list(convergence = res$convergence, counts = res$evaluations, message = res$message)
+		}
+
+	return(list(lambda = res$par, convergence = conv, 
+			obj = mean(.rho(gt,res$par, derive=0,type=type,k=k))))	
+	}
+
+getLamb <- function(gt, l0, type = c('EL', 'ET', 'CUE', "ETEL"), tol_lam = 1e-7, maxiterlam = 100, tol_obj = 1e-7, 
 		k = 1, 	method = c("nlminb", "optim", "iter"), control=list())
 	{
 	method <- match.arg(method)
 	if(is.null(dim(gt)))
 		gt <- matrix(gt,ncol=1)
-	l0 <- rep(0,ncol(gt))
 
 	if (method == "iter")
 		{
@@ -179,7 +214,7 @@
                 kernel = c("Truncated", "Bartlett"), bw = bwAndrews, approx = c("AR(1)", 
     		"ARMA(1,1)"), prewhite = 1, ar.method = "ols", tol_weights = 1e-7, tol_lam = 1e-9, tol_obj = 1e-9, 
 		tol_mom = 1e-9, maxiterlam = 100, constraint = FALSE, optfct = c("optim", "optimize", "nlminb"), 
-                optlam = c("nlminb", "optim", "iter"), Lambdacontrol = list(), model = TRUE, X = FALSE, Y = FALSE, TypeGel = "baseGel", ...)
+                optlam = c("nlminb", "optim", "iter"), Lambdacontrol = list(), model = TRUE, X = FALSE, Y = FALSE, TypeGel = "baseGel", alpha = NULL, ...)
 	{
 
 	type <- match.arg(type)
@@ -194,7 +229,7 @@
 		tol_weights = tol_weights, tol_lam = tol_lam, tol_obj = tol_obj, tol_mom = tol_mom, 
 		maxiterlam = maxiterlam, constraint = constraint, optfct = optfct, weights = weights,
                 optlam = optlam, model = model, X = X, Y = Y, TypeGel = TypeGel, call = match.call(), 
-		Lambdacontrol = Lambdacontrol)
+		Lambdacontrol = Lambdacontrol, alpha = alpha)
 
 	class(all_args)<-TypeGel
 	Model_info<-getModel(all_args)
@@ -205,24 +240,39 @@
 	}
 
 
-  .thetf <- function(tet, P, output=c("obj","all"))
+  .thetf <- function(tet, P, output=c("obj","all"), l0Env)
     {
     output <- match.arg(output)
     gt <- P$g(tet, P$dat)
-    if (P$optlam != "optim" & P$type == "EL") 
+    l0 <- get("l0",envir=l0Env)
+    if (is.null(P$CGEL))
+	{
+	if (P$optlam != "optim" & P$type == "EL") 
 	    {
-	    lamb <- try(getLamb(gt, type = P$type, tol_lam = P$tol_lam, maxiterlam = P$maxiterlam, 
+	    lamb <- try(getLamb(gt, l0, type = P$type, tol_lam = P$tol_lam, maxiterlam = P$maxiterlam, 
 			tol_obj = P$tol_obj, k = P$k1/P$k2, control = P$Lambdacontrol, 
 			method = P$optlam), silent = TRUE)
-	    if(class(lamb) == "try-error")
-		    lamb <- getLamb(gt, type = P$type, tol_lam = P$tol_lam, maxiterlam = P$maxiterlam, 
+            if(class(lamb) == "try-error")
+		    lamb <- getLamb(gt, l0, type = P$type, tol_lam = P$tol_lam, maxiterlam = P$maxiterlam, 
 			tol_obj = P$tol_obj, k = P$k1/P$k2, control = P$Lambdacontrol, method = "optim")
 	    }
+	    else
+		    lamb <- getLamb(gt, l0, type = P$type, tol_lam = P$tol_lam, maxiterlam = P$maxiterlam, 
+			tol_obj = P$tol_obj, k = P$k1/P$k2, control = P$Lambdacontrol, method = P$optlam)
+	}
     else
-	    lamb <- getLamb(gt, type = P$type, tol_lam = P$tol_lam, maxiterlam = P$maxiterlam, 
-			tol_obj = P$tol_obj, k = P$k1/P$k2, control = P$Lambdacontrol, method = P$optlam)
-
+	{
+	if (P$type=="ETEL")
+		stop("CGEL not implemented for ETEL")
+	lamb <- try(.getCgelLam(gt, l0, type = P$type, method = "nlminb", control=P$Lambdacontrol, 
+			k = P$k1/P$k2, alpha = P$CGEL),silent=TRUE)
+	if (class(lamb) == "try-error")
+		lamb <- try(.getCgelLam(gt, l0, type = P$type, method = "constrOptim", control=P$Lambdacontrol, 
+			k = P$k1/P$k2, alpha = P$CGEL),silent=TRUE)
+	}
+	
     obj <- mean(.rho(gt, lamb$lambda, type = P$typet, derive = 0, k = P$k1/P$k2))
+    assign("l0",lamb$lambda,envir=l0Env)
     if(output == "obj")
 	    return(obj)
     else

Modified: pkg/gmm/R/getModel.R
===================================================================
--- pkg/gmm/R/getModel.R	2012-04-30 20:51:09 UTC (rev 54)
+++ pkg/gmm/R/getModel.R	2012-05-24 03:18:08 UTC (rev 55)
@@ -122,7 +122,7 @@
     
     if(is.null(object$weightsMatrix))
       {
-      if (object$vcov == "iid" & object$wmatrix != "ident")
+      if (object$vcov == "iid" & object$wmatrix != "ident" & object$type != "cue")
       	{
           clname <- "baseGmm.twoStep.formula"
           object$type <- "Linear model with iid errors: Regular IV or 2SLS"
@@ -268,7 +268,6 @@
         }
       return(gt)
       }
-
     gradv <- function(tet, dat, pt = NULL)
       {
       x <- dat$x
@@ -286,7 +285,14 @@
     P$dat <- dat
     P$gform <- P$g
     P$g <- g
-    P$gradv <- gradv
+    if (P$smooth)
+	{
+	P$gradv <- .Gf
+	P$gradvf <- FALSE
+    } else {
+	P$gradv <- gradv
+	P$gradvf <- TRUE
+	}
     }	
   else
     {
@@ -320,25 +326,36 @@
         }
     P$g1 <- P$g
 
-    rgmm <- gmm(P$g, P$dat, P$tet0, wmatrix = "ident")
-    P$bwVal <- P$bw(centeredGt <- lm(P$g(rgmm$coefficients, P$dat)~1), kernel = P$wkernel, prewhite = P$prewhite, 
-               ar.method = P$ar.method, approx = P$approx)
-    P$w <- smoothG(residuals(centeredGt), bw = P$bwVal)$kern_weights
+    gt <- gmm(P$g, P$dat, P$tet0, wmatrix = "ident")$gt
+    gt <- sweep(gt,2,colMeans(gt),FUN="-")
+    class(gt) <- "gmmFct"	
+    if (is.function(P$bw))
+	    P$bwVal <- P$bw(gt, kernel = P$wkernel, prewhite = P$prewhite, 
+	               ar.method = P$ar.method, approx = P$approx)
+    else
+	    P$bwVal <- P$bw
 
-    P$g <- function(thet, x, g1 = P$g1, bw = P$bwVal)
+    P$w <- smoothG(gt, bw = P$bwVal)$kern_weights
+    attr(P$dat,"smooth") <- list(bw=P$bwVal, w=P$w, g = P$g1)
+
+    P$g <- function(thet, x)
       {
-      gf <- g1(thet, x)
+      gf <- attr(x,"smooth")$g(thet, x)
+      bw <- attr(x,"smooth")$bw
       gt <- smoothG(gf, bw = bw)$smoothx
       return(gt)
       }
+    P$q <- ncol(gt)
     }
   else
    {
+   P$q <- ncol(P$g(P$tet0, P$dat))
    P$k1 <- 1
    P$k2 <- 1
    P$w <- kernel(1)
    P$bwVal <- 1
    }	
+  P$CGEL <- P$alpha
   class(P) <- clname
   return(P)
   }

Modified: pkg/gmm/R/gmmTests.R
===================================================================
--- pkg/gmm/R/gmmTests.R	2012-04-30 20:51:09 UTC (rev 54)
+++ pkg/gmm/R/gmmTests.R	2012-05-24 03:18:08 UTC (rev 55)
@@ -134,12 +134,15 @@
 	bread <- t(fT)%*%solve(Vff,D)
 	K <- bread%*%solve(meat,t(bread))/V$n
 	pv <- 1-pchisq(K,dfK)
-	J <- t(fT)%*%solve(Vff,fT)/V$n-K
+	S <- t(fT)%*%solve(Vff,fT)/V$n
+	J <- S-K
+        dfS <- dfK +  dfJ
 	pvJ <- 1-pchisq(J,dfJ)
-	type <- c("K statistics","J statistics")
-	test <- c(K,J)
-	test <- cbind(test,c(pv,pvJ),c(dfK,dfJ))
-	dist <- paste("Chi_sq with ", c(dfK,dfJ), " degrees of freedom", sep="")
+	type <- c("K statistics","J statistics", "S statistics")
+	test <- c(K,J,S)
+        pvS <- 1-pchisq(S,dfS)
+	test <- cbind(test,c(pv,pvJ,pvS),c(dfK,dfJ,dfS))
+	dist <- paste("Chi_sq with ", c(dfK,dfJ,dfS), " degrees of freedom", sep="")
 	if(dfJ>0)
 		ans <- list(test=test,dist=dist,type=type,testName=testName)
 	else
@@ -212,6 +215,11 @@
 
 KConfid <- function(obj, which, type = c("K", "KJ"), alpha = 0.05, alphaJ = 0.01, n = 4)
 	{
+	if (is.element("multicore", installed.packages()[,1])) 
+		theApply <- mclapply
+	else
+		theApply <- lapply
+
 	type <- match.arg(type)
 	if ( (obj$df == 0) & (type == "KJ"))
 		stop("Only K type is available for just identified models")
@@ -277,7 +285,7 @@
 			else
 				return(res$root)
 			}
-		res <- mclapply(c(-1,1), getBoth)
+		res <- theApply(c(-1,1), getBoth)
 		c(res[[1]],res[[2]])
 	} else {
 		step <- 5*sqrt(diag(vcov(obj)))[which]
@@ -290,6 +298,10 @@
 
 .getCircle <- function(x0,y0,g,n,b, trace=FALSE,  ...)
 	{
+	if (is.element("multicore", installed.packages()[,1])) 
+		theApply <- mclapply
+	else
+		theApply <- lapply
 	tol=1e-4
 	if (any(b<=0))
 		stop("b must be strictly positive")
@@ -312,7 +324,7 @@
 	# get the four points of the cross
 	selectf <- list(f,f,f2,f2)
 	selectd <- c(1,-1,1,-1)
-	xy12 <- mclapply(1:4, function(i) try(uniroot(selectf[[i]],c(x0,x0+selectd[i]*b[1]),y0=y0,tol=tol)$root,silent=TRUE))
+	xy12 <- theApply(1:4, function(i) try(uniroot(selectf[[i]],c(x0,x0+selectd[i]*b[1]),y0=y0,tol=tol)$root,silent=TRUE))
 
 	x1 <- xy12[[1]]
 	x2 <- xy12[[2]]
@@ -329,14 +341,14 @@
 		return(c(xt,yt))
 		}
 
-	res1 <- mclapply(lambda,getAll,dir=1,x=x1)
-	res2 <- mclapply(lambda,getAll,dir=-1,x=x2)
+	res1 <- theApply(lambda,getAll,dir=1,x=x1)
+	res2 <- theApply(lambda,getAll,dir=-1,x=x2)
 	res1 <- t(simplify2array(res1))
 	res2 <- t(simplify2array(res2))
 	solU <- rbind(c(x2,y0),res2[length(lambda):1,],c(f3(x0), f3(y1)),res1,c(x1,y0))
 
-	res1 <- mclapply(lambda,getAll,dir=-1,x=x1)
-	res2 <- mclapply(lambda,getAll,dir=1,x=x2)
+	res1 <- theApply(lambda,getAll,dir=-1,x=x1)
+	res2 <- theApply(lambda,getAll,dir=1,x=x2)
 	res1 <- t(simplify2array(res1))
 	res2 <- t(simplify2array(res2))
 	solD <- rbind(res2[length(lambda):1,],c(f3(x0), f3(y2)),res1)

Modified: pkg/gmm/R/momentEstim.R
===================================================================
--- pkg/gmm/R/momentEstim.R	2012-04-30 20:51:09 UTC (rev 54)
+++ pkg/gmm/R/momentEstim.R	2012-05-24 03:18:08 UTC (rev 55)
@@ -623,25 +623,29 @@
   {
   P <- object
   g <- P$g
+  l0Env <- new.env()
+  assign("l0",rep(0,P$q),envir=l0Env)
+
   n <- nrow(P$dat$x)
   if (!P$constraint)
     {
     if (P$optfct == "optim")
-      res <- optim(P$tet0, .thetf, P = P, ...)
+      res <- optim(P$tet0, .thetf, P = P, l0Env = l0Env, ...)
     if (P$optfct == "nlminb")
-      res <- nlminb(P$tet0, .thetf, P = P, ...)
+      res <- nlminb(P$tet0, .thetf, P = P, l0Env = l0Env, ...)
 	
     if (P$optfct == "optimize")
       { 
-      res <- optimize(.thetf, P$tet0, P = P, ...)
+      res <- optimize(.thetf, P$tet0, P = P, l0Env = l0Env, ...)
       res$par <- res$minimum
       res$convergence <- "There is no convergence code for optimize"
       }
     }
+
   if(P$constraint)
-    res <- constrOptim(P$tet0, .thetf, grad = NULL, P = P, ...)
+    res <- constrOptim(P$tet0, .thetf, grad = NULL, P = P, l0Env = l0Env, ...)
 
-  All <- .thetf(res$par, P, "all")
+  All <- .thetf(res$par, P, "all",l0Env = l0Env)
   gt <- All$gt
   rlamb <- All$lambda
 
@@ -653,7 +657,6 @@
   z$gt <- gt
   rhom <- .rho(z$gt, z$lambda, type = P$typet, k = P$k1/P$k2)
   z$pt <- -.rho(z$gt, z$lambda, type = P$typet, derive = 1, k = P$k1/P$k2)/n
-
   # Making sure pt>0
   if (P$type=="CUE")
 	{
@@ -684,7 +687,11 @@
     names(z$lambda) <- nameh
     }
 
-  G <- P$gradv(z$coefficients, P$dat, z$pt)
+ if(P$gradvf)
+    G <- P$gradv(z$coefficients, P$dat)
+  else
+    G <- P$gradv(z$coefficients, P$dat, g = P$g, z$pt)
+
   khat <- crossprod(c(z$pt)*z$gt,z$gt)/(P$k2)*P$bwVal
   G <- G/P$k1 
 
@@ -714,7 +721,7 @@
   z$k1 <- P$k1
   z$k2 <- P$k2
   z$khat <- khat
-
+  z$CGEL <- P$CGEL
   class(z) <- paste(P$TypeGel, ".res", sep = "")
   return(z)
   }
@@ -724,25 +731,27 @@
   P <- object
   x <- P$x
   n <- ifelse(is.null(dim(x)),length(x),nrow(x))
+  l0Env <- new.env()
+  assign("l0",rep(0,P$q),envir=l0Env)
   if (!P$constraint)
     {
     if (P$optfct == "optim")
-      res <- optim(P$tet0, .thetf, P = P, ...)
+      res <- optim(P$tet0, .thetf, P = P, l0Env = l0Env, ...)
     if (P$optfct == "nlminb")
-      res <- nlminb(P$tet0, .thetf, P = P, ...)
+      res <- nlminb(P$tet0, .thetf, P = P, l0Env = l0Env, ...)
 	
     if (P$optfct == "optimize")
       { 
-      res <- optimize(.thetf, P$tet0, P = P, ...)
+      res <- optimize(.thetf, P$tet0, P = P, l0Env = l0Env, ...)
       res$par <- res$minimum
       res$convergence <- "There is no convergence code for optimize"
       }
     }
 
   if(P$constraint)
-    res <- constrOptim(P$tet0, .thetf, grad = NULL, P = P, ...)
+    res <- constrOptim(P$tet0, .thetf, grad = NULL, P = P,l0Env = l0Env, ...)
 
-  All <- .thetf(res$par, P, "all")
+  All <- .thetf(res$par, P, "all",l0Env = l0Env)
   gt <- All$gt
   rlamb <- All$lambda
 
@@ -797,11 +806,14 @@
   z$k1 <- P$k1
   z$k2 <- P$k2
   z$khat <- khat
+  z$CGEL <- P$CGEL
 
   class(z) <- paste(P$TypeGel, ".res", sep = "")
   return(z)
   }
 
+
+
 momentEstim.fixedW.formula <- function(object, ...)
   {
   P <- object

Modified: pkg/gmm/man/gel.Rd
===================================================================
--- pkg/gmm/man/gel.Rd	2012-04-30 20:51:09 UTC (rev 54)
+++ pkg/gmm/man/gel.Rd	2012-05-24 03:18:08 UTC (rev 55)
@@ -13,7 +13,7 @@
     approx = c("AR(1)", "ARMA(1,1)"), prewhite = 1, ar.method = "ols", tol_weights = 1e-7, 
     tol_lam = 1e-9, tol_obj = 1e-9, tol_mom = 1e-9, maxiterlam = 100, constraint = FALSE,
     optfct = c("optim", "optimize", "nlminb"), optlam = c("nlminb", "optim", "iter"), Lambdacontrol = list(), model = TRUE, 
-    X = FALSE, Y = FALSE, TypeGel = "baseGel",...)
+    X = FALSE, Y = FALSE, TypeGel = "baseGel", alpha = NULL, ...)
 }
 \arguments{
 \item{g}{A function of the form \eqn{g(\theta,x)} and which returns a \eqn{n \times q} matrix with typical element \eqn{g_i(\theta,x_t)} for \eqn{i=1,...q} and \eqn{t=1,...,n}. This matrix is then used to build the q sample moment conditions. It can also be a formula if the model is linear (see details below).  }
@@ -60,6 +60,8 @@
 
 \item{TypeGel}{The name of the class object created by the method \code{getModel}. It allows developers to extand the package and create other GEL methods.}
 
+\item{alpha}{Regularization coefficient for discrete CGEL estimation (experimental). By setting alpha to any value, the model is estimated by CGEL of type specified    by the option \code{type}. See Chausse (2011)}
+
 \item{...}{More options to give to \code{\link{optim}}, \code{\link{optimize}} or \code{\link{constrOptim}}.}
 
 }
@@ -147,10 +149,15 @@
 \emph{Journal of Statistical Software}, \bold{16}(9), 1--16.
 URL \url{http://www.jstatsoft.org/v16/i09/}.
 
-Pierre Chausse (2010), Computing Generalized Method of Moments and Generalized Empirical Likelihood with R.
+Chausse (2010), Computing Generalized Method of Moments and Generalized Empirical Likelihood with R.
  \emph{Journal of Statistical Software}, \bold{34}(11), 1--35.
  URL \url{http://www.jstatsoft.org/v34/i11/}.
 
+Chausse (2011), Generalized Empirical likelihood for a continumm of moment conditions.
+ \emph{Working Paper}, 
+ \emph{Department of Economics},
+ \emph{University of Waterloo}.
+
 }
 \examples{
 # First, an exemple with the fonction g()

Modified: pkg/gmm/man/getLamb.Rd
===================================================================
--- pkg/gmm/man/getLamb.Rd	2012-04-30 20:51:09 UTC (rev 54)
+++ pkg/gmm/man/getLamb.Rd	2012-05-24 03:18:08 UTC (rev 55)
@@ -8,12 +8,14 @@
  It computes the vector of Lagrange multipliers, which maximizes the GEL objective function, using an iterative Newton method.
 }
 \usage{
-getLamb(gt, type = c("EL","ET","CUE", "ETEL"), tol_lam = 1e-7, maxiterlam = 100, tol_obj = 1e-7, k = 1, 
+getLamb(gt, l0, type = c("EL","ET","CUE", "ETEL"), tol_lam = 1e-7, maxiterlam = 100, tol_obj = 1e-7, k = 1, 
 	method = c("nlminb", "optim", "iter"), control = list())
 }
 \arguments{
 \item{gt}{A \eqn{n \times q} matrix with typical element \eqn{g_i(\theta,x_t)}}
 
+\item{l0}{Vector of starting values for lambda}
+
 \item{type}{"EL" for empirical likelihood, "ET" for exponential tilting and "CUE" for continuous updated estimator. See details for "ETEL".}
 
 \item{tol_lam}{Tolerance for \eqn{\lambda} between two iterations. The algorithm stops when \eqn{\|\lambda_i -\lambda_{i-1}\|} reaches \code{tol_lam} }



More information about the Gmm-commits mailing list