Announcement

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

  • Imposing both linear and non-linear restrictions on regression (Style analysis)

    Hi all,

    Currently I am working on my master's thesis for Finance (Quantitative Finance).
    I would like to perform a return-based style analysis in the following form:

    r_ctr= r_industry{1} + r_industry{2}+r_industry{3}+r_industry{4}+r_indust ry{5} + r_industry{6}+r_industry{7}+r_industry{8}+r_indust ry{9}+r_industry{10}

    The restrictions I would like to impose on this regression is that all coefficients should be non-negative (1)(i.e., no short positions allowed) and that the sum of the coefficients is equal to one (2).
    Using
    constraint 2 Basic_Mat + Cons_Gds + Cons_Svs + Financials + Healthcare + Industrials + Oil_Gas + Technology + Telecom + Utilities = 1
    cnsreg Belgium Basic_Mat Cons_Gds Cons_Svs Financials Healthcare Industrials Oil_Gas Technology Telecom Utilities, constraint(2) robust

    one can easily impose restriction (2) to the regression.

    However, if one uses cnsreg to impose the following constraint (1):
    constraint 1 Basic_Mat>=0 &Cons_Gds>=0 &Cons_Svs>=0 &Financials>=0 &Healthcare>=0 &Industrials>=0 &Oil_Gas>=0 &Telecom>=0& Utilities>=0
    STATA generates an error stating that one has requested a test of a hypothesis that is nonlinear in the variables (r(131).

    I have tried using the nl command, such that one can impose non-linear constraints, however I have not been able to figure out how to sum up to 1 using nl.
    Does anyone know how to impose both restriction (1) (non-linear) and restriction (2) (linear) to the regression?

    Thanks in advance!



  • #2
    You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. of all your calculations I don't know exactly what you're doing in the r_ctr equation.

    I'm not expert in constraints or cnsreg, but my reading of the help file is that cnsreg does linear constraints and >= is not a linear constraint. When you run this, do you get any negative parameters? If not, then you don't need the constraints.

    see also : https://www.stata.com/support/faqs/s...l-constraints/
    https://www.stata.com/statalist/arch.../msg00162.html
    https://www.stata.com/statalist/arch.../msg00290.html

    Comment


    • #3
      I don't have much experience with constraints either, but constraining a coefficent in a regression to be positive seems very odd to me. And what if the expectation, or conditonal expectation of y on x_i is negative...? What would you expect the estimation to be?

      Comment

      Working...
      X