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!
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!
Comment