Displaying 20 results from an estimated 900 matches similar to: "Constrained Regression"
2008 Mar 03
2
Constrained regression
Dear list members,
I am trying to get information on how to fit a linear regression with
constrained parameters. Specifically, I have 8 predictors , their
coeffiecients should all be non-negative and add up to 1. I understand it is
a quadratic programming problem but I have no experience in the subject. I
searched the archives but the results were inconclusive.
Could someone provide suggestions
2007 Sep 03
2
The quadprog package
Hi everybody,
I'm using Windows XP Prof, R 2.5.1 and a Pentium 4 Processor.
Now, I want to solve a quadratic optimization program (Portfolio Selection) with the quadprog package
I want to minimize (\omega'%*%\Sigma%*%\omega)
Subject to
(1) \iota' %*% \omega = 1 (full investment)
(2) R'%*%\omega = \mu (predefined expectation value)
(3) \omega \ge 0 (no short sales).
Where
2005 Jan 13
1
how to use solve.QP
At the risk of ridicule for my deficient linear algebra skills, I ask
for help using the solve.QP function to do portfolio optimization. I
am trying to following a textbook example and need help converting the
problem into the format required by solve.QP. Below is my sample code
if anyone is willing to go through it. This problem will not solve
because it is not set up properly. I hope I
2009 Feb 16
2
solve.QP with box and equality constraints
Dear list,
I am trying to follow an example that estimates a 2x2 markov transition
matrix across several periods from aggregate data using restricted least
squares.
I seem to be making headway using solve.QP(quadprog) as the unrestricted
solution matches the example I am following, and I can specify simple
equality and inequality constraints. However, I cannot correctly specify a
constraint
2006 Jun 06
1
Problems using quadprog for solving quadratic programming problem
Hi,
I'm using the package quadprog to solve the following quadratic programming problem.
I want to minimize the function
(b_1-b_2)^2+(b_3-b_4)^2
by the following constraints b_i, i=1,...,4:
b_1+b_3=1
b_2+b_4=1
0.1<=b_1<=0.2
0.2<=b_2<=0.4
0.8<=b_3<=0.9
0.6<=b_4<=0.8
In my opinion the solution should be b_1=b_2=0.2 und b_3=b_4=0.8.
Unfortunately R doesn't find
2005 Nov 29
1
Constraints in Quadprog
I'm having difficulty figuring out how to implement the
following set of constraints in Quadprog:
1). x1+x2+x3+x4=a1
2). x1+x2+x5+x6=a2
3). x1+x3+x5+x7=a3
4). x1+x2=b1
5). x1+x3=b2
6). x1+x5=b3
for the problem: MIN (x1-c1)2+(x2-c2)2+...+(x8-c8)2.
As far a I understand, "solve.QP(Dmat, dvec, Amat, bvec, meq=0,
factorized=FALSE)" reads contraints using an element-by-element
2013 Mar 15
1
quadprog issues---how to define the constriants
Hi list:
This is my first time to post my question on the list. Thanks for your
help.
I am solving a quadratic programming using R. Here is my question:
w = arg min 0.5*w'Mw - w'N
s. t. sum(w) = 1;
w>0
note: w is weight vector, each w_i must >=0, and the sum of w =1.
Here is my R code:
A <-matrix(c(2.26,1.26,1.12,1.12,2.27,1.13,1.12,1.13,2.2),3,3);
B <-
2009 Nov 04
3
Constrained Optimization
Hi All,
I'm trying to do the following constrained optimization example.
Maximize x1*(1-x1) + x2*(1-x2) + x3*(1-x3)
s.t. x1 + x2 + x3 = 1
x1 >= 0 and x1 <= 1
x2 >= 0 and x2 <= 1
x3 >= 0 and x3 <= 1
which are the constraints.
I'm expecting the answer x1=x2=x3 = 1/3.
I tried the "constrOptim" function in R and I'm running into some issues.
I first start off
2013 Apr 04
5
Help for bootstrapping‏
I have a set of data for US t-bill returns and US stock returns frm 1980-2012. I am trying to bootstrap the data and obtain the minimum variance portfolio and repeat this portfolio 1000 times. However I am unable to get the correct code function for the minimum variance portfolio. When I tried to enter Opt(OriData+1, 1, 5, 0), I get "error:subscript out of bounds" Please help!
2003 Jun 02
1
Help with factorized argument in solve.QP
Hi
I'm having problems getting the "factorized" argument in solve.QP (part
of the quadprog library) to work as expected. The helpfile states that
when the factorized argument is set to TRUE, then the function requires
the inverse of a square-root factor of the Hessian instead of the
Hessian itself. That is, when factorized=TRUE, the Dmat argument should
be a matrix R^(-1), such
2010 Feb 19
1
Quadprog help
I am having some problems using Quadprog in R. I want to minimize the
objective function :
200*P1-1/2*10*P1^2+100*P2-1/2*5*P2^2+160*P3-1/2*8*P3^2+50*P4-1/2*10*P4^2+50*P
5-1/2*20*P5^2+50*P6-1/2*10*P6^2,
Subject to a set of constrains including not only the variables P1, P2, P3,
P4, P5, P6, but also the variables X1, X2,X3,X4,X5,X6,X7,X8,X9.
As the set of variables X's are not
2010 Dec 04
1
Quadratic programming with semi-definite matrix
Hello.
I'm trying to solve a quadratic programming problem of the form min
||Hx - y||^2 s.t. x >= 0 and x <= t using solve.QP in the quadprog
package but I'm having problems with Dmat not being positive definite,
which is kinda okay since I expect it to be numerically semi-definite
in most cases. As far as I'm aware the problem arises because the
Goldfarb and Idnani method first
2007 Dec 06
1
Solve.QP
Hi there,
I have a major problem (major for me that is) with solve.QP and I'm new at this. You see, to solve my quadratic program I need to have the lagrange multipliers after each iteration. Solve.QP gives me the solution, the unconstrained solution aswell as the optimal value. Does anybody have an idea for how I could extract the multipliers?
Thanx,
Serge
"Beatus qui prodest quibus
2007 Dec 22
1
using solve.qp without a quadratic term
I was playing around with a simple example using solve.qp ( function is in the quadprog package ) and the code is below. ( I'm not even sure there if there is a reasonable solution because I made the problem up ).
But, when I try to use solve.QP to solve it, I get the error that D in the quadratic function is not positive
definite. This is because Dmat is zero
because I don't have a
2010 Oct 22
2
Bayesian constrained regression method?
Hello everyone,
I am trying to estimate the parameter b.
I have Y and X1 which I know and they are both random. However, I also have
X2 which I don't know and is also random. I want to estimat b from the
model:
Y = b*X1 + ( 1 - b ) * X2
Can anyone offer some suggestions. The values of Y and X1 are both pvalues
so they are constrained in (0,1).
--
Thanks,
Jim.
[[alternative HTML version
2009 Nov 11
1
Help with fPortfolio
Hi
I'm getting the following errors while using the efficientPortfolio function
even though I'm setting the target return to the mean of the TargetReturn I
obtain from the portfolio object created by the feasiblePortfolio function.
First Error:
Error: targetReturn >= min(mu) is not TRUE
Second Error:
Error in .rquadprog(Dmat = args$Dmat, dvec = args$dvec, Amat = args$Amat, :
2008 Jan 20
2
Efficient way for multiplying vectors with a only certain number of rows in a matrix
Dear R-users,
I am working on a problem that I am currently not able to solve efficiently.
It is about multiplying one column of a matrix with only a certain number of
rows of another matrix.
Let me illustrate my problem with an example:
n.obs = 800
n.rowsperobs = 300
n.param = 23
Designmat = matrix(rnorm(n.obs*n.rowsperobs*n.param),ncol=n.param)
Betamat =
2007 Dec 05
1
Quadratic programming
Hi,
I'm quite new at R and I haven't found the answer to my question anywhere on the net, so either it is trivial or not documented. So, bare with be.
I am using the quadprog package and its solve.QP routine to solve and quadratic programming problem with inconsistent constraints, which obviously doesn't work since the constraint matrix doesn't have full rank. A way to solve this
2012 Mar 16
1
quadprog error?
I forgot to attach the problem data, 'quadprog.Rdata' file, in my prior
email.
I want to report a following error with quadprog. The solve.QP function
finds a solution to the problem below that violates the last equality
constraint. I tried to solve the same problem using ipop from kernlab
package and get the solution in which all equality constraints are
enforced. I also tried an old
2010 Sep 20
2
how to seperate " "? or how to do regression on each variable when I have multiple variables?
Dear All,
I have data which contains 14 variables. And I have to regress one of
variables on each variable (simple 13 linear regressions)
I try to make a loop and store only R-squared
colnames(boston)
[1] "CRIM" "ZN" "INDUS" "CHAS" "NOX" "RM" "AGE"
[8] "DIS" "RAD"