Questions tagged [r-optimization]

R Optimization Infrastructure Packages (ROI). Also add the language specific [r] tag to your question.

The R-package ROI offers an extensible infrastructure to model linear, quadratic, conic and general nonlinear optimization problems. The infrastructure also offers many different solvers, reformulations, problem collections and functions to address optimization problems in many formats.

17 questions
5
votes
0 answers

PortfolioAnalytics - ROI optimize.rebalancing using redenominated monthly prices produces incorrect result?

Hope that someone could help or has experienced a similar situation to point me in the direction of what is going wrong. Here is my setup (see hopefully reproducible code further below): build a list of symbols get instrument data via…
4
votes
1 answer

R: use of ROI package

I am trying to use the R package ROI for a simple portfolio optimization problem. I can get the results using the quadprog solver "manually", but I'd really like to understand how the ROI package works. Unfortunately I run into an error, even though…
bigsleep
  • 327
  • 2
  • 7
  • 15
1
vote
1 answer

maximizing function using optim in r where one of the parameters is an integer

I have a function that I need to maximize that contains 3 parameters, one of which is an integer. How do I let the optim function know to maximize (instead of minimize which is the default). And how do I let it know that one of the parameters in an…
1
vote
0 answers

Non-linear optimization in R - non-linear constraints

I'm new to optimization in R and to R at all, Trying to implement the following set of equations - to find the Maximum, Minimum and intersections and maximum and minimum values for intersect points. a specific form of the function is: P =…
Amidavid
  • 177
  • 7
1
vote
2 answers

How to pass nonlinear objective functions into ROI package in R?

I'm trying to tackle a nonlinear optimization problem where the objective functions are non-linear and constraints are linear. I read a bit on the ROI package in R and I decided to use the same. However, I am facing a problem while solving the…
1
vote
1 answer

ROI package doesn't give a solution (qpoases solver) for an unconstrained QP

I'm setting up a simple QP to test the ROI R package. However, the package isn't able to give a wrong solution to a simple toy problem when it is unconstrained. Example, # Maximize -1/2 x^2 + x, no constraints > x <- OP(Q_objective(as.matrix(-1),…
1
vote
1 answer

Calling ROI "LP "and "QP" functions

I am trying to reproduce some of the examples given by the ROI creators. For example in http://statmath.wu.ac.at/courses/optimization/Presentations/ROI-2011.pdf (slides 15-17) there is the example: library("ROI") #ROI: R Optimization…
Marco Stamazza
  • 836
  • 9
  • 15
1
vote
2 answers

R/PortfolioAnalytics optimize.portfolio()

I have spent multiple hours trying to understand what is required to successfully utilize the optimize.portfolio() function from the PortfolioAnalytics package, but I receive multiple errors, despite trying various optimize_methods (e.g.,…
user2662565
  • 509
  • 2
  • 9
  • 22
1
vote
1 answer

R ROI_solve error

I am not able to find the R package "ROI.plugin.cplex" anywhere. Any ideas how to get that package? I am running Ubuntu 14.04 and R version 3.2.2 I tried install.packages("ROI.plugin.cplex", repos="http://R-Forge.R-project.org")
anonR
  • 849
  • 7
  • 26
0
votes
1 answer

Weighted vertex cover (as linear programming) in R with the ROI package

I'm trying to solve an instance of the weighted vertex cover problem using R for homework and I can't seem to get it right. I'm using the ROI package (could just as well use linprog). The instance looks like this: Edges: A-B, A-C, A-G, B-C, …
Matej
  • 625
  • 7
  • 14
0
votes
2 answers

How to read a GAMS gms file into ROI (R Optimisation Interface)?

I have a NLP model written in GAMS and I would like to use ROI (R Optimisation Interface) to send it to the NEOS Server. It looks like ROI_read() is the command for reading in external models, but I don't know how to find out or install the correct…
Simon Woodward
  • 1,946
  • 1
  • 16
  • 24
0
votes
0 answers

optim function in r returning a list with an error message

I ran the optim function on a function that has 3 numeric parameters. It did return what looks to be the correct values. However, in the message element of the returned list, I got this message: $par [1] 0.8974235 9.1095283 0.9110162 $value [1]…
0
votes
1 answer

How to write a constraint that references the Objective in R optimization

Here is the objective I would like to maximize in R: AX1+BX2+CX3+DX4 The following constraints exists 0 >= S2 >= 8 0 >= S3 >= 8 0 >= S4 >= 8 0 >= S5 >= 8 Where S2 = X1 + V S3 = X2 + X1 + V S4 = X3 + X2 + X1 + V S5 = X4 + X3 + X2 + X1 +…
Doptima
  • 171
  • 1
  • 1
  • 10
0
votes
1 answer

ROI lpsolve plugin gets wrong result with binary constraint

I am trying to use lp_solve solver through ROI interface (ROI.plugin.lpsolve) and get random result on MIP problem. Here is my example where I was expecting 0/1 binary…
Bulat
  • 6,869
  • 1
  • 29
  • 52
0
votes
1 answer

Run multiple linear optimisation in parallel using R software

I set up a small linear programming for optimizing crop yields given a yield response curve to Nitrogen (with a linear response with a plateau corresponding to the maximum reachable yield). I wrote this LP program using the OPEN-OR CLP solver in R…
1
2