similar to: QP.solve, QPmat, constraint matrix, and positive definite

Displaying 20 results from an estimated 1000 matches similar to: "QP.solve, QPmat, constraint matrix, and positive definite"

2011 Feb 04
2
always about positive definite matrix
1. Martin Maechler's comments should be taken as replacements for anything I wrote where appropriate. Any apparent conflict is a result of his superior knowledge. 2. 'eigen' returns the eigenvalue decomposition assuming the matrix is symmetric, ignoring anything in m[upper.tri(m)]. 3. The basic idea behind both posdefify and nearPD is to compute the
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
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 Jun 19
1
more powerful iconv
R community, As you may know, R's iconv doesn't work well converting to and from encodings that allow embedded nulls. For example > iconv("foo", to="UTF-16") Error in iconv("foo", to = "UTF-16") : embedded nul in string: '\xff\xfef\0o\0o\0' However, I don't believe embedded nulls are at issue here, but rather that R's iconv
2023 Feb 23
1
Compilation Error when DEBUG_approx Toggled on in RISC-V
Hi all, While compiling R to RISC-V64 architecture and debugging in R's C source codes, I think I have found a small bug. Can anyone please verify whether it is a real bug? The possible bug lies in the file `R-4.2.2/src/library/stats/src/approx.c` in function `R_approxfun` around line 148: #ifdef DEBUG_approx REprintf("R_approxfun(x,y, nxy = %.0f, .., nout = %.0f, method = %d,
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
2018 Feb 15
0
Help with factorized argument in solve.QP
Hello David, same problem here with solve.QP. dykstra is causing problems as well and giving for the value NA if factorized = TRUE: library(quadprog) library(Dykstra) R<-cbind(c(1,1),c(0,1)); d<-c(t(R)%*%R%*%c(2,1)) solve.QP(solve(R),d,-as.matrix(c(1,1)),-2,1,factorized = TRUE) S<-t(R)%*%R; solve.QP(S,d,-as.matrix(c(1,1)),-2,1)
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 Apr 01
2
Need Advice on Matrix Not Positive Semi-Definite with cholesky decomposition
Dear fellow R Users: I am doing a Cholesky decomposition on a correlation matrix and get error message the matrix is not semi-definite. Does anyone know: 1- a work around to this issue? 2- Is there any approach to try and figure out what vector might be co-linear with another in thr Matrix? 3- any way to perturb the data to work around this? Thanks for any suggestions.
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
2010 Oct 21
4
how do I make a correlation matrix positive definite?
Hi, If a matrix is not positive definite, make.positive.definite() function in corpcor library finds the nearest positive definite matrix by the method proposed by Higham (1988). However, when I deal with correlation matrices whose diagonals have to be 1 by definition, how do I do it? The above-mentioned function seem to mess up the diagonal entries. [I haven't seen this complication, but
2007 Jul 02
1
QP for solving Support Vector Regression
Dear R users, I'm trying to run the Support Vector Regression by a general quadratic programming function like ipop ( ) in kernlab or solve.QP ( ) in quadprog packages. Since they are general, their application in Support Vector Regression can lead to misunderstanding, particularly when constructing matrices. Even their examples are general and applied in Support Vector
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
2006 Nov 22
1
question about the "solve" function in library "Matrix"
Hi: I have some problems when I use the function "solve" function in a loop. In the following code, I have a diagonal martix "ttt" whose elements change in every iteration in a loop. I defined a "dpoMatrix"class before the loop so I do not need to define this class every time in the loop. The reason is to save some computing time. The code is below. The inverse
2012 Jan 12
1
How can I prevent solve.QP from printing the solution progress ?
Dear R Users, How can I prevent solve.Qp from printing the solution progress ? Thanks in advance, Tolga This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at
2006 Jul 24
1
conflict of package "Matrix" and summary of lme object
After loading the package "Matrix" (version 0.995-12), using the summary function with an lme (package nlme version 3.1-75) object results in an error message saying Fehler in dim(x) : kein Slot des Namens "Dim" f?r dieses Objekt der Klasse "correlation" (translated: 'Error in dim(x) : no slot of the name "Dim" for this object of class
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 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
0
regarding lack of quadratic term in solve.qp
I was thinking about my solve.qp problem on my way home tonight and I think I can fix it by making Dmat the identity matrix. I'll check this weekend to make sure but my thinking is that doing this will make all the "variances" the same so that they shouldn't come into play during the evaluation of the objective function. Thanks though for any confirmation of this or other
2007 Sep 21
1
Is it solve.QP or is it me?
Hi. Here are three successive examples of simple quadratic programming problems with the same structure. Each problem has 2*N variables, and should have a solution of the form (1/N,0,1/N,0,...,1/N,0). In these cases, N=4,5,6. As you will see, the N=4 and 6 cases give the expected solution, but the N=5 case breaks down. >cm8 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1 0