Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can mata impose inequality constraints when using optimize function

    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)
    }

  • #2
    The general tricks are discussed here: https://www.stata.com/support/faqs/s...l-constraints/
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Originally posted by Maarten Buis View Post
      The general tricks are discussed here: https://www.stata.com/support/faqs/s...l-constraints/
      Hi Maarten, Transformation does work in some situations, Thank you!

      Comment

      Working...
      X