Hello everyone, I am trying to impose an inequality constraint on optimize function. Because I want to for estimate production function and the coefficients of the production function, for example Cobb-Douglas production function, have to be greater than 0 and less than 1, I need to constraint betas[i]>0&betas[i]<1,i=1,2,3. I checked the help documentation of the optimize function and I know how to impose equality constraints by using optimize_init_constraints, but I don't know how to impose an inequality constraint. Can anyone give me some advice on this? Thanks very much.
Code:
void GMM_DLW_CD(todo,betas,crit,g,H) { PHI=st_data(.,("phi")) PHI_LAG=st_data(.,("phi_lag")) Z=st_data(.,("const","m_lag","l_lag","k")) X=st_data(.,("const","m","l","k")) X_lag=st_data(.,("const","m_lag","l_lag","k_lag")) Y=st_data(.,("q")) C=st_data(.,("const")) OMEGA=PHI-X*betas' OMEGA_lag=PHI_LAG-X_lag*betas' OMEGA_lag_pol=(C,OMEGA_lag) 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) }
Comment