悬赏 100 个论坛币 未解决
md<-matrix(Y,X,Z)
> g1<-function(tet,md){
+
+ m1<-t(md[,1]-md[,2:4]%*%matrix(c(tet[1],tet[2],tet[3]))-G0)%*%(md[,2:4]-E0) #第一个式子
+ m2<-t(md[,1]-md[,2:4]%*%matrix(c(tet[1],tet[2],tet[3]))- G0)%*%diag(array(G1))%*%(md[,6:7]-E1) #第二个式子
+
+ f<-cbind(m1,m2)
+
+ return(f)
+ }#构造方程,G0,G1,E0,E1都已知
> print(res<-gmm(g1,md,c(beta1_hat=0,beta2_hat=0,beta3_hat=0)))
Error in ar.ols(x, aic = aic, order.max = order.max, na.action = na.action, :
'order.max' must be < 'n.used'