# How to calculate BIC and AIC for a gmm model in #R using #plm?

I originally posted this question here. But I think it is better suited for here.

I am running Generalized Method of Moments (GMM) Estimation for Panel Data in R using the plm. I have set of valid instruments, and I would like to select one using BIC-GMM or AIC-GMM criteria for instance. However, when I tried to compute using the standard R command AIC, but shows an error. I would like to compute a function from scratch, but I don't know which is the right formula for the GMM context. I'm using the differenced transformation, which basically is the Arrellano and Bond, (1991) estimator.

library('plm')
plm.gmm <-
pgmm(
dynformula(as.formula(model), lg),
data = pdata,
effect = 'twoway',
model = 'twostep',
transformation = 'd',
gmm.inst = Z[[i]],
lag.gmm =  c(lg.gmm[[i]][[1]], lg.gmm[[i]][[2]])
)
AIC(plm.gmm, k=2)
Error in UseMethod("logLik") :
no applicable method for 'logLik' applied to an object of class "c('pgmm', 'panelmodel')"


In this website I found the following formula: $$AIC= N + SSE*\log{(k*\pi)} + N*\log{(SSE/N)} + k * (1+1)$$

• N=Number of observations.
• SSE=Sum of squared residuals.
• k=Penalty per parameter.

I have two questions, can I use this formula in the context of GMM panel estimation, and what it's the intuition behind (1+1) term.

• how do you get the plm.gmm object? – DataD'oh Sep 13 '17 at 11:18
• What do you mean by GMM? Gaussian mixture models? – DataD'oh Sep 13 '17 at 11:19
• Hi – DataD'oh, I changed a bit my question to reply to your comments. – Mario GS Sep 13 '17 at 12:07