Announcement

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

  • Constrained Nonlinear Regression

    Hi all,

    I am trying to estimate the parameter delta using the nl command in Stata 15.1, as follows:

    nl (depvar=ln(1+sum(var1/(var2^{delta})))), in(delta .05).

    The command works fine, but returns a negative value. The problem is, the intuition of the model requires that delta be constrained between 0 and 1. I cannot find a way to constrain the parameter using the nl command. Does anyone have suggestions as to how I could constrain and estimate the parameter?

    Note: I have altered the initial value significantly, but continue to get a negative estimate.

    Best,

    Adam

  • #2
    Something you could try is the following:
    Code:
    nl (depvar=ln(1+sum(var1/(var2^(exp({delta}))))), in(delta .05).
    That way exp(delta) will Always be positive, even though delta can take negative values. The only problem is that if the original coefficient is indeed negative in the data, the model may not converge, or you will get a large but negative delta.
    Hope it helps

    Comment


    • #3
      Are you sure that you've specified your regression model correctly? For example, with sum() in there, your regression coefficient will necessarily change just by the sort order of the dataset.

      Comment

      Working...
      X