-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.html
519 lines (469 loc) · 17.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head lang="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
<meta name="description" content="Disciplined Convex Programming in R">
<meta name="generator" content="Hugo 0.80.0" />
<title> CVXR</title>
<link rel="stylesheet" href="./css/alabaster.css" type="text/css" />
<link rel="stylesheet" href="./css/pygments.css" type="text/css" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon"/>
</head>
<body role="document">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Convex Optimization in R</h1>
<script src="./rmarkdown-libs/kePrint/kePrint.js"></script>
<link href="./rmarkdown-libs/lightable/lightable.css" rel="stylesheet" />
<div id="what-is-cvxr" class="section level2">
<h2>What is <code>CVXR</code>?</h2>
<p><code>CVXR</code> is an R package that provides an object-oriented modeling
language for convex optimization, similar to <code>CVX</code>, <code>CVXPY</code>, <code>YALMIP</code>,
and <code>Convex.jl</code>. It allows the user to formulate convex optimization
problems in a natural mathematical syntax rather than the restrictive
standard form required by most solvers. The user specifies an
objective and set of constraints by combining constants, variables,
and parameters using a library of functions with known mathematical
properties. <code>CVXR</code> then applies
signed <a href="./post/cvxr_dcp">disciplined convex programming (DCP)</a> to
verify the problem’s convexity. Once verified, the problem is
converted into standard form using graph implementations and
passed to a quadratic solver such as <a href="https://osqp.org/">OSQP</a>, or a cone solver such
as <a href="https://github.com/embotech/ecos">ECOS</a>
or <a href="https://github.com/cvxgrp/scs">SCS</a>, or even commericial solvers,
if installed.</p>
</div>
<div id="citing-cvxr" class="section level2">
<h2>Citing <code>CVXR</code></h2>
<p><code>CVXR</code> is published in <span class="citation">Fu, Narasimhan, and Boyd (<a href="#ref-cvxr2020">2020</a>)</span>
<<a href="https://dx.doi.org/10.18637/jss.v094.i14">doi:10.18637/jss.v094.i14</a>>. A
BibTeX citation entry using citation key <code>cvxr2020</code> is below.</p>
<pre><code>@Article{cvxr2020,
title = {{CVXR}: An {R} Package for Disciplined Convex Optimization},
author = {Anqi Fu and Balasubramanian Narasimhan and Stephen Boyd},
journal = {Journal of Statistical Software},
year = {2020},
volume = {94},
number = {14},
pages = {1--34},
doi = {10.18637/jss.v094.i14},
}</code></pre>
</div>
<div id="supported-solvers" class="section level2">
<h2>Supported Solvers</h2>
<table class="table table-striped" style="margin-left: auto; margin-right: auto;">
<thead>
<tr>
<th style="text-align:left;">
Solver
</th>
<th style="text-align:left;">
R package
</th>
<th style="text-align:left;">
LP
</th>
<th style="text-align:left;">
QP
</th>
<th style="text-align:left;">
SOCP
</th>
<th style="text-align:left;">
SDP
</th>
<th style="text-align:left;">
EXP
</th>
<th style="text-align:left;">
MIP
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
CBC
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://github.com/dirkschumacher/rcbc">rcbc</a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
CLARABEL
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://Clarabel.org">clarabel</a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
GLPK
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://cran.r-project.org/package=Rglpk"><code>Rglpk</code></a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
GLPK_MI
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://cran.r-project.org/package=Rglpk"><code>Rglpk</code></a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
OSQP
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://www.osqp.org">osqp</a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
CPLEX
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://cran.r-project.org/package=Rcplex">Rcplex</a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
ECOS
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://cran.r-project.org/package=ECOSolveR">ECOSolveR</a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
ECOS_BB
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://cran.r-project.org/package=ECOSolveR">ECOSolveR</a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
GUROBI
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://www.gurobi.com/documentation/10.0/refman/r_ins_the_r_package.html">gurobi</a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
MOSEK
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://docs.mosek.com/latest/rmosek/index.html">Rmosek</a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
</tr>
<tr>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
SCS
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
<a href="https://cran.r-project.org/package=scs">scs</a>
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
<td style="text-align:left;background-color: rgba(236, 236, 236, 255) !important;">
✓
</td>
</tr>
</tbody>
</table>
<p>For more detail, see <a href="./cvxr_examples/cvxr_using-other-solvers/">Using other solvers</a>.</p>
</div>
<div id="news" class="section level2">
<h2>News</h2>
<p>For the latest news, please see the <a href="https://www.cvxgrp.org/CVXR">Package
Documentation</a>.</p>
<p><code>CVXR</code> continues to be developed on
<a href="https://github.com/cvxgrp/CVXR">Github</a>. Version 1.0 was a major
release implementing the reductions framework described in
<span class="citation">Agrawal et al. (<a href="#ref-rewriting:2018">2018</a>)</span>. More details of all the changes can be found in
<a href="./cvxr_examples/whats_new_1.0/">What’s new in 1.0</a>.</p>
</div>
<div id="installing-cvxr" class="section level2">
<h2>Installing <code>CVXR</code></h2>
<p><code>CVXR</code> is installed like any other R package from
<a href="https://cloud.r-project.org">CRAN</a>.</p>
</div>
<div id="documentation" class="section level2">
<h2>Documentation</h2>
<p>Two videos provide a good starting point:</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=MyglbtnmQ8A">Anqi Fu’s talk</a> at
<a href="http://user2018.r-project.org">useR! 2018</a></li>
<li><a href="http://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/CVXR-An-R-Package-for-Modeling-Convex-Optimization-Problems">Anqi’s
talk</a>
at <a href="http://user2016.r-project.org">useR! 2016</a> introducing <code>CVXR</code>.</li>
</ul>
<p>Materials form our <a href="http://user2019.r-project.org/tutorials/">useR!
2019</a> including exercises
and solutions are available as a <a href="https://github.com/bnaras/cvxr_tutorial">bookdown
project</a>. Follow the
instructions in the README.</p>
<p>An introductory vignette is installed with the package and can be
viewed using <code>vignette("cvxr_intro", package = "CVXR")</code>.</p>
<p>A large set of examples, many ported from <code>CVXPY</code>, are available on
this site in the <a href="./post/cvxr_examples/">Examples</a> section.</p>
</div>
<div id="acknowledgements" class="section level2">
<h2>Acknowledgements</h2>
<p>We are grateful to <a href="https://stevendiamond.me">Steven
Diamond</a>, <a href="https://millerjohnp.github.io/">John Miller</a>, and Paul
Kunsberg Rosenfield for their contributions to the software’s
development. In particular, we are indebted to Steven Diamond for his
work on <a href="http://www.cvxpy.org">CVXPY</a>. Most of <code>CVXR</code>’s
code, documentation, and examples were ported from the Python library.</p>
</div>
<div id="about-this-site" class="section level2">
<h2>About this site</h2>
<p>Much of the documentation on this site was modified
from <a href="https://cvxpy.org"><code>CVXPY</code></a> in a semi-automated way.</p>
<p>This site was constructed
using <a href="http://rmarkdown.rstudio.com/">R markdown documents</a>, the
wonderful <a href="https://cloud.r-package.org/package=%22blogdown%22">blogdown</a>
package by <a href="https://yihui.name/">Yihui Xie</a>, and
the
<a href="https://themes.gohugo.io/theme/hugo-alabaster-theme/">Hugo Alabaster theme</a>. The
pages are served out of
the <a href="https://github.com/bnaras/cvxr_docs">CVXR docs</a> repository.</p>
</div>
<div id="references" class="section level2 unnumbered">
<h2>References</h2>
<div id="refs" class="references csl-bib-body hanging-indent" entry-spacing="0">
<div id="ref-rewriting:2018" class="csl-entry">
Agrawal, Akshay, Robin Verschueren, Steven Diamond, and Stephen Boyd. 2018. <span>“A Rewriting System for Convex Optimization Problems.”</span> <em>Journal of Control and Decision</em> 5 (1): 42–60. <a href="https://doi.org/10.1080/23307706.2017.1397554">https://doi.org/10.1080/23307706.2017.1397554</a>.
</div>
<div id="ref-cvxr2020" class="csl-entry">
Fu, Anqi, Balasubramanian Narasimhan, and Stephen Boyd. 2020. <span>“<span>CVXR</span>: An <span>R</span> Package for Disciplined Convex Optimization.”</span> <em>Journal of Statistical Software</em> 94 (14): 1–34. <a href="https://doi.org/10.18637/jss.v094.i14">https://doi.org/10.18637/jss.v094.i14</a>.
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="./">
<img class="logo" src="./favicon.ico" alt="Logo"/>
<h1 class="logo logo-name"></h1>
</a>
</p>
<p class="blurb">Disciplined Convex Programming in R</p>
<p>
<iframe src="https://ghbtns.com/github-btn.html?user=cvxgrp&repo=CVXR&type=watch&count=true&size=large"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>
<h3>Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference internal" href="./">Home</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="./cvxr_examples/whats_new_1.0">What's new in 1.0</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="https://www.cvxgrp.org/CVXR">Package docs</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="./cvxr_examples/cvxr_intro/">Quick intro</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="./cvxr_examples/cvxr_gentle-intro/">Longer intro</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="./examples/">Tutorial examples</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="./cvxr_dcp/">DCP</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="./cvxr_faq/">FAQ</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="./cvxr_functions/">Function reference</a>
</li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<script type="text/javascript" src="https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</div>
</body>
</html>