Hi Enrico,
Thanks for your answer. I tried the third alternative, which I need with my
two constraints. But I get the error message: Amat and dvec are
incompatible!
Can you help me again?
Regards Phillip
--
View this message in context:
Dear all,
I already asked about to run a constrained regression like y=b0 +
b1X1+b2x2+b3x3, with constraints:
b1+b2+b3=1 and b1,b2,b3=0. I thought it will run with style.QPfit with the
performance Analytic packages.
However the style.QPfit function does not estimate an intercept. As i really
Hi Philipp,
you should be able to solve this with package quadprog/solve.QP.
require(quadprog)
p - 3## number of regressors
T - 100 ## number of obs
X - array(rnorm(T*p), dim = c(T,p))
X - cbind(1,X) ## add a constant
y - rnorm(T)
## variant 1 -- linear regression
coef(lm(y ~ -1 + X))