Comformability error 3200 : stata mata

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Comformability error 3200 : stata mata

Jackie Lee
This post has NOT been accepted by the mailing list yet.
Hello, Statalist!

I am getting the following error due to the code(replicate,  "Detecting Learning by Exporting, AER, 2012" :
My data dont have missing variable and I did update stata11. I have no clue about this error. Please help me to correct this problems :
 
                 GMM_1():  3200  conformability error
      opt__calluser0_d():     -  function returned error
          opt__eval_nm():     -  function returned error
opt__looputil_iter0_nm():     -  function returned error
          opt__loop_nm():     -  function returned error
              optimize():     -  function returned error
                MODEL1():     -  function returned error
                 <istmt>:     -  function returned error

my stata version is :

Stata/SE 11.2 for Windows (32-bit)
Born 16 Feb 2012
Copyright 1985-2009 StataCorp LP


Program

mata:

void GMM_1(todo,betas,crit,g,H)
{
        PHI=st_data(.,("phi"))
        PHI_LAG=st_data(.,("phi_lag"))
        Z=st_data(.,("const","l_lag","k"))
        X=st_data(.,("const","l","k"))
        X_lag=st_data(.,("const","l_lag","k_lag"))
        Y=st_data(.,("y"))
        C=st_data(.,("const"))
       
        OMEGA=PHI-X*betas'
        OMEGA_lag=PHI_LAG-X_lag*betas'
    OMEGA_lag2_EXP=OMEGA_lag2:*OMEGA_lag
    OMEGA_lag3_EXP=OMEGA_lag3:*OMEGA_lag
    OMEGA_lag_pol=(C,OMEGA_lag,OMEGA_lag2,OMEGA_lag3)
        g_b = invsym(OMEGA_lag_pol'OMEGA_lag_pol)*OMEGA_lag_pol'OMEGA
        XI=OMEGA-OMEGA_lag_pol*g_b
        crit=(Z'XI)'(Z'XI)
}

end
* note here starting values are simply entered. Use OLS estimates as starting values.
mata:
void MODEL1()
        {
S=optimize_init()
optimize_init_evaluator(S, &GMM_1())
optimize_init_evaluatortype(S,"d0")
optimize_init_technique(S, "nm")
optimize_init_nmsimplexdeltas(S, 0.1)
optimize_init_which(S,"min")
optimize_init_params(S,(2,0.8,0.2))
p=optimize(S)
p
st_matrix("beta1",p)
}
end

//produce parameters on law of motion, directly related to decomposition of total productivity effect
*---------------------------------------------------------------------------------------------------------------*

cap program drop MODEL1
program MODEL1, rclass
preserve
sort Id year
mata MODEL1()
end

Thanks!

Jackie