Announcement

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

  • [nl] fit a regression with interval inequality constraints

    Hello everyone

    I am trying to fit a linear regression with an inequality as in http://www.stata.com/support/faqs/st...l-constraints/

    However, I want to impose that a < 0.
    Mathematically it would make sense to say that (-a) > 0.

    In my case, a = alpha + 0.0025

    This would mean that alpha + 0.0025 < 0 and, therefore, (-alpha) - 0.0025 > 0. How do I fit this?

    Thank you in advance

  • #2
    b' = -exp(b) is always negative. That might give you an idea about parameterisation.

    (I'm not a great fan of these constraints. If you have to exert brute force to get the fit you think you deserve, the model is not a good idea for the data.)

    Comment


    • #3
      Thank you for your help

      My problem is related with the [sspace] command. I needed to impose a similar constraint but this model does not allow me to impose nonlinear constraints.
      As a consequence, I was studying the possibility of trying to impose these constraints through the initial estimators of the state space model, which would be obtained through the [nl] command.
      I know it is not correct but I am a bit desperate with this.
      However, it does not seem to be possible to do this with the [nl] command either, as I tried to apply your suggestion and STATA displayed:
      Parameter lnd2 taken as constant term in model & ANOVA table
      Any suggestion regarding this?

      Here is my regression
      nl (y = {a1} * (ynat) + {a2} * (L.y) + {a3} * (L2.y) - {a2} * (L.ynat) - {a3} * (L2.ynat) - (exp({lnd2})+0.0025) * (L.ffr) - (exp({lnd2})+0.0025) * (L2.ffr) + (exp({lnd2})+0.0025) * (LD.ypot1) + (exp({lnd2})+0.0025) * (L2D.ypot1)) if !missing3

      my notation is a4 = -0.0025 - d2 <=> -a4 = 0.0025 + d2 <=> -a4 = exp(ln(d2 + 0.0025)) <=> a4 = - exp(ln(d2 + 0.0025))

      Thank you in advance

      Comment


      • #4
        NOTE: therefore, a4 = - (exp({lnd2})+0.0025)

        Comment

        Working...
        X