similar to: quadprog error?

Displaying 20 results from an estimated 1000 matches similar to: "quadprog error?"

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
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
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
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 <-
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
2004 Sep 01
0
not positive definite D matrix in quadprog
Hello to everybody, I have a quadratic programming problem that I am trying to solve by various methods. One of them is to use the quadprog package in R. When I check positive definiteness of the D matrix, I get that one of the eigenvalues is negative of order 10^(-8). All the others are positive. When I set this particular eigenvalue to 0.0 and I recheck the eigenvalues in R, the last
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
2010 Jan 21
0
fPortfolio prob: maxreturnPortfolio() returns Na/NaN/Inf error
Hi - First posting here. I am using fPortfolio to try and optimize a simple portfolio consisting of 5 daily return series. I want to maximize return subject to setTargetRisk(myspec)=0.08 using only constraints="LongOnly" I can run feasiblePortfolio() using a spec file that specifies the weights, and it works fine. When I run maxreturnPortfolio(mydata,myspec,"LongOnly"),
2007 Jul 02
0
relocation error in grDevices.so
(Warning: I'm not an R guy. I'm a Python guy trying to get the R-Python interface working again after some upgrades.) I'm trying to upgrade our numpy/rpy/matplotlib environment (Solaris 10/Intel, Python 2.4). In the process I found I needed to rebuild R (2.1.1) because it was compiled with gcc 3.3.2 and we have since migrated to gcc 3.4.1. I'm using this configure setup:
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 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
2001 Nov 20
0
Summary: non-negative least squares
Thank you Brian Ripley, Gardar Johannesson, and Marcel Wolbers for your prompt and friendly help! I will share any further learnings as I move through these suggestions. -Bob Abugov Brian Ripley wrote: I just use optim() on the sum of squares with non-negativity constraints. That did not exist in 1999. Gardar Johannesson wrote: You can always just use the quadratic programing library in R
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
2006 Nov 08
0
Solving a maximization problem using QUADPROD
Hello, here is an example from the manual. How to turn this minimization problem into maximization problem, i.e. -(0 5 0) %*% b - 1/2 b^T b? # Assume we want to minimize: -(0 5 0) %*% b + 1/2 b^T b # under the constraints: A^T b >= b0 # with b0 = (-8,2,0)^T # and (-4 2 0) # A = (-3 1 -2) # ( 0 0 1) # we can use solve.QP.compact as follows: # library(quadprog) Dmat <- matrix(0,3,3)
2008 May 08
0
solve.QP() error
I got following error while I was using solve.QP() in my problem: > Dmat = matrix(c(0.0001741, 0.0001280, 0.0001280, 0.0002570), nrow=2) > dvec = t(c(0,0)) > Amat = matrix(c(-1,1,0,-1,0, 1,0,1,0,-1), nrow=5) > bvec = c(-20000, 1, 1, -50000, -50000) > solve.QP(Dmat,dvec,Amat,bvec=bvec) Error in solve.QP(Dmat, dvec, Amat, bvec = bvec) : Amat and dvec are incompatible! >
2007 Jul 11
0
Some questions about quadratic programming (QP)
Dear R Users , As a beginner in QP, I'm trying to solve a Support Vector Machine problem by a QP. In particulare I am using the quadprog package. My questions are here: 1- In the document for the package (The quadprog Package), the inequality constraint is mentioned with >= , however in a standard QP, this usaully is written with <= . This constraint should be multiplied by a
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!
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, :
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