Before going any further, I have to check, what is:
MinQuadProg qp
Also, if I'm following the C++ code correctly, H, is an identity matrix.
This implies the input to the C++ solver, requires the QP in a
different form to the R solver.
In which case, the C++ inputs and the R inputs, should be diffe
Thank you for giving me your time!
The problem is the quadratic optimization part. Something goes wrong along
the way. In C++ loops run from 0 and in R they run from 1, and I've tried
to take that into account. Still I'm having hard time figuring out the
mistake I make, cause I get a result from m
> I'm trying to replicate a C++ code with R.
Notes:
(1) I'd recommend you make the code more modular.
i.e. One function for initial data prep/modelling, one function for
setting up and solving the QP, etc.
This should be easier to debug.
(However, you would probably have to do it to the C++ code f
I really appreciate you helping me with this! I just don't seem to figure
it out.
(1) I don't know why you think bvec should be a matrix. The
documentation clearly says it should be a vector (implying not a
matrix).
- I've written it in a form of a matrix with one row and 2*J-3
columns. (0,2*J-3,
I was wondering if you're trying to fit a curve, subject to
monotonicity/convexity constraints...
If you are, this is a challenging topic, best of luck...
On Tue, Sep 22, 2020 at 8:12 AM Abby Spurdle wrote:
>
> Hi,
>
> Sorry, for my rushed responses, last night.
> (Shouldn't post when I'm about
Hi,
Sorry, for my rushed responses, last night.
(Shouldn't post when I'm about to log out).
I haven't used the quadprog package for nearly a decade.
And I was hoping that an expert using optimization in finance in
economics would reply.
Some comments:
(1) I don't know why you think bvec should b
Thank you for your response!
Bvec is supposed to be a matxit. I'm following the solve.QP (
https://www.rdocumentation.org/packages/quadprog/versions/1.5-8/topics/solve.QP
).
I'm not sure what would be the best way to solve a quadratic programming
problem in R.
ma 21. syysk. 2020 klo 13.20 Abby
One more thing, is bvec supposed to be a matrix?
Note you may need to provide a reproducible example, for better help...
On Mon, Sep 21, 2020 at 10:09 PM Abby Spurdle wrote:
>
> Sorry, ignore the last part.
> What I should have said, is the inequality has the opposite sign.
> >= bvec (not <= bve
Sorry, ignore the last part.
What I should have said, is the inequality has the opposite sign.
>= bvec (not <= bvec)
On Mon, Sep 21, 2020 at 10:05 PM Abby Spurdle wrote:
>
> Are you using the quadprog package?
> If I can take a random shot in the dark, should bvec be -bvec?
>
>
> On Mon, Sep 21,
Are you using the quadprog package?
If I can take a random shot in the dark, should bvec be -bvec?
On Mon, Sep 21, 2020 at 9:28 PM Maija Sirkjärvi
wrote:
>
> Hi!
>
> I was wondering if someone could help me out. I'm minimizing a following
> function:
>
> \begin{equation}
> $$\sum_{j=1}^{J}(m_{j}
On 19/07/2015 4:58 PM, Preetam Pal wrote:
> Hi,
> If i have a quadratic objective function with a system of linear constraints
> for multiple variables, is there any inbuilt function that i can use?
Google says the quadprog package should help.
Duncan Murdoch
__
We don't do homework on this list: also, this is basic calculus, not quadratic
programming.
Best,
Michael
On Jul 24, 2012, at 1:10 PM, Joel Muli wrote:
> hi,
> what code in R would I use to solve the problem below?
>
> An apartment complex has 250 apartments to rent.If they rent x apartments
Maximizing f(x) = x'Ax makes sense only when A is negative-definite.
Therefore, this is the same as minimizing x'Bx, where B = -A, and B is
positive-definite.
In other words, you should be able to simply flip the sign of the original
matrix . This should yield a positive-definite matrix sinc
Sorry, that should've been sum(diag(D)) or max(eigen(D)$values) in stead of
max(diag(D)).
Tsjerk
On Jan 3, 2012 4:52 PM, "Tsjerk Wassenaar" wrote:
Hi Riccardo,
Would it be possible to use max(diag(D))*diag(ncol(D)) - D ? That also
reverses the order of eigenvalues/-vectors.
Cheers,
Tsjerk
>
Hi Riccardo,
Would it be possible to use max(diag(D))*diag(ncol(D)) - D ? That also
reverses the order of eigenvalues/-vectors.
Cheers,
Tsjerk
On Jan 2, 2012 4:35 PM, "riccardo24" wrote:
Hi, I need to maximize a quadratic function under constraints in R.
For minimization I used solve.QP but f
I don't have experience with this in R and I'm not sure I understand the
question that well but maybe something like nearPD()?
Ken Hutchison
On Jan 2, 2012, at 6:36 AM, riccardo24 wrote:
> Hi, I need to maximize a quadratic function under constraints in R.
> For minimization I used solve.QP
Andreas Jensen gmail.com> writes:
> 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
Hi,
The CRAN Task View on Optimization may help:
http://stat.ethz.ch/CRAN/web/views/Optimization.html
HTH,
Stephan
barbara.r...@uniroma1.it schrieb:
Devo risolvere un problema di minimo vincolato con vincoli di uguaglianza e un
altro con vincoli di uguaglianza e disuguaglianza.
Cosa posso ut
G'day Jorge,
On Fri, 15 Feb 2008 17:51:16 -0500
"Jorge Aseff" <[EMAIL PROTECTED]> wrote:
> I am using solve.QP (from quadprog) to solve a standard quadratic
> programming problem: min_w -0.5*w'Qw st ... I would like solve.QP to
> do two things: 1) to start the optimization from a user-supplied
>
>From: Jorge Aseff <[EMAIL PROTECTED]>
>Date: 2008/02/15 Fri PM 04:51:16 CST
>To: r-help@r-project.org
>Subject: [R] Quadratic Programming
Adrian Trapletti has a function in his tseries
package ( the name of the function escapes me ) that uses the solve.QP solver
to model some kind of quadratic p
G'day Serge,
On Wed, 5 Dec 2007 11:25:41 +0100
"de Gosson de Varennes Serge (4100)"
<[EMAIL PROTECTED]> wrote:
> 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
21 matches
Mail list logo