Nonlinear GMM in R resulting in matrix multiplication error

by SeamusX   Last Updated August 07, 2017 09:19 AM

I'm running a GMM estimation with a numerical integration that contains parameters in the moment condition. The gmm() function returns the following error:

> res<-gmm(g,x,init,type="twoStep",wmatrix="ident",method="Nelder-Mead")
Error in AA %*% t(X) : requires numeric/complex matrix/vector arguments
In addition: Warning message:
In ar.ols(x, aic = aic, order.max = order.max, na.action = na.action,  :
  model order:  1 singularities in the computation of the projection matrix 
results are only valid up to model order 0

It's not clear at which point this error occurs, but it appears after a lengthy process and stops the codes, so my guess is that the program has completed the minimization problem and it occurs at some point during the covariance matrix calculation, some possibilities I can think of:

  • Not all columns of the x matrix is used. I tried to limit it to the columns used in the estimation only, but the same errors occurs. Maybe the columns are not correctly ordered.
  • The numerical derivatives for the gradient matrix failed. I'm trying to avoid providing a direct gradient matrix because of the large number of parameters.
  • The GMM package is not compatible with numerical integration within the moment conditions.

If anyone has some insight on this it would be greatly appreciated.

Related Questions

Double integration in R

Updated July 24, 2017 23:19 PM

Rollmean vs. Integrate.xy for computing Integrals

Updated July 17, 2017 15:19 PM

R. Numerical integration of a plnorm() object

Updated August 30, 2017 11:19 AM