annotate doc/interpreter/optim.txi @ 19630:0e1f5a750d00

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Jan 2015 10:24:46 -0500
parents c9113e28fae8 446c46af4b42
children 4197fc428c7d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 17152
diff changeset
1 @c Copyright (C) 1996-2013 John W. Eaton
7018
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
2 @c
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
3 @c This file is part of Octave.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
4 @c
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
5 @c Octave is free software; you can redistribute it and/or modify it
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
6 @c under the terms of the GNU General Public License as published by the
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
7 @c Free Software Foundation; either version 3 of the License, or (at
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
8 @c your option) any later version.
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
9 @c
7018
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
13 @c for more details.
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
14 @c
7018
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
15 @c You should have received a copy of the GNU General Public License
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
16 @c along with Octave; see the file COPYING. If not, see
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6939
diff changeset
17 @c <http://www.gnu.org/licenses/>.
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
18
4167
aae05d51353c [project @ 2002-11-12 02:52:50 by jwe]
jwe
parents: 3368
diff changeset
19 @node Optimization
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
20 @chapter Optimization
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
21
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
22 Octave comes with support for solving various kinds of optimization
9068
5d3059e2a34c Cleanup documentation for optim.texi, set.texi
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
23 problems. Specifically Octave can solve problems in Linear Programming,
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
24 Quadratic Programming, Nonlinear Programming, and Linear Least Squares
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
25 Minimization.
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
26
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
27 @menu
17152
f2a8592b8fbd doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents: 14138
diff changeset
28 * Linear Programming::
f2a8592b8fbd doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents: 14138
diff changeset
29 * Quadratic Programming::
f2a8592b8fbd doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents: 14138
diff changeset
30 * Nonlinear Programming::
f2a8592b8fbd doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents: 14138
diff changeset
31 * Linear Least Squares::
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
32 @end menu
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
33
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
34 @c @cindex linear programming
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
35 @cindex quadratic programming
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
36 @cindex nonlinear programming
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
37 @cindex optimization
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
38 @cindex LP
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
39 @cindex QP
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
40 @cindex NLP
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
41
4246
0253850a08d7 [project @ 2002-12-30 17:57:36 by jwe]
jwe
parents: 4167
diff changeset
42 @node Linear Programming
0253850a08d7 [project @ 2002-12-30 17:57:36 by jwe]
jwe
parents: 4167
diff changeset
43 @section Linear Programming
0253850a08d7 [project @ 2002-12-30 17:57:36 by jwe]
jwe
parents: 4167
diff changeset
44
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
45 Octave can solve Linear Programming problems using the @code{glpk}
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
46 function. That is, Octave can solve
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
47
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
48 @tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
49 $$
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
50 \min_x c^T x
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
51 $$
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
52 @end tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
53 @ifnottex
10828
322f43e0e170 Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents: 9642
diff changeset
54
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
55 @example
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
56 min C'*x
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
57 @end example
10828
322f43e0e170 Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents: 9642
diff changeset
58
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
59 @end ifnottex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
60 subject to the linear constraints
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
61 @tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
62 $Ax = b$ where $x \geq 0$.
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
63 @end tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
64 @ifnottex
10828
322f43e0e170 Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents: 9642
diff changeset
65 @math{A*x = b} where @math{x @geq{} 0}.
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
66 @end ifnottex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
67
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
68 @noindent
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
69 The @code{glpk} function also supports variations of this problem.
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
70
6502
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 4246
diff changeset
71 @DOCSTRING(glpk)
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 4246
diff changeset
72
4167
aae05d51353c [project @ 2002-11-12 02:52:50 by jwe]
jwe
parents: 3368
diff changeset
73 @node Quadratic Programming
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
74 @section Quadratic Programming
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
75
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
76 Octave can also solve Quadratic Programming problems, this is
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
77 @tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
78 $$
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
79 \min_x {1 \over 2} x^T H x + x^T q
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
80 $$
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
81 @end tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
82 @ifnottex
10828
322f43e0e170 Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents: 9642
diff changeset
83
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
84 @example
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
85 min 0.5 x'*H*x + x'*q
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
86 @end example
10828
322f43e0e170 Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents: 9642
diff changeset
87
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
88 @end ifnottex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
89 subject to
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
90 @tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
91 $$
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
92 Ax = b \qquad lb \leq x \leq ub \qquad A_{lb} \leq A_{in} \leq A_{ub}
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
93 $$
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
94 @end tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
95 @ifnottex
10828
322f43e0e170 Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents: 9642
diff changeset
96
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
97 @example
9068
5d3059e2a34c Cleanup documentation for optim.texi, set.texi
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
98 @group
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
99 A*x = b
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
100 lb <= x <= ub
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
101 A_lb <= A_in*x <= A_ub
9068
5d3059e2a34c Cleanup documentation for optim.texi, set.texi
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
102 @end group
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
103 @end example
10828
322f43e0e170 Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents: 9642
diff changeset
104
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
105 @end ifnottex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
106
6502
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 4246
diff changeset
107 @DOCSTRING(qp)
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 4246
diff changeset
108
9642
2ab5ace09d8b doc/interpreter/optim.txi: document pqpnonneg
John W. Eaton <jwe@octave.org>
parents: 9209
diff changeset
109 @DOCSTRING(pqpnonneg)
2ab5ace09d8b doc/interpreter/optim.txi: document pqpnonneg
John W. Eaton <jwe@octave.org>
parents: 9209
diff changeset
110
4167
aae05d51353c [project @ 2002-11-12 02:52:50 by jwe]
jwe
parents: 3368
diff changeset
111 @node Nonlinear Programming
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
112 @section Nonlinear Programming
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
113
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
114 Octave can also perform general nonlinear minimization using a
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
115 successive quadratic programming solver.
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
116
6502
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 4246
diff changeset
117 @DOCSTRING(sqp)
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 4246
diff changeset
118
4167
aae05d51353c [project @ 2002-11-12 02:52:50 by jwe]
jwe
parents: 3368
diff changeset
119 @node Linear Least Squares
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
120 @section Linear Least Squares
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
121
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
122 Octave also supports linear least squares minimization. That is,
6939
46d1ad37d943 [project @ 2007-10-01 16:12:20 by jwe]
jwe
parents: 6778
diff changeset
123 Octave can find the parameter @math{b} such that the model
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
124 @tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
125 $y = xb$
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
126 @end tex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
127 @ifnottex
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
128 @math{y = x*b}
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
129 @end ifnottex
8828
8463d1a2e544 Doc fixes.
Brian Gough <bjg@network-theory.co.uk>
parents: 8817
diff changeset
130 fits data @math{(x,y)} as well as possible, assuming zero-mean
6741
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
131 Gaussian noise. If the noise is assumed to be isotropic the problem
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
132 can be solved using the @samp{\} or @samp{/} operators, or the @code{ols}
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
133 function. In the general case where the noise is assumed to be anisotropic
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
134 the @code{gls} is needed.
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
135
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
136 @DOCSTRING(ols)
00116015904d [project @ 2007-06-18 16:07:14 by jwe]
jwe
parents: 6502
diff changeset
137
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3294
diff changeset
138 @DOCSTRING(gls)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
139
7984
bbaa5d7d0143 Some documentation updates
David Bateman <dbateman@free.fr>
parents: 7018
diff changeset
140 @DOCSTRING(lsqnonneg)
8286
6f2d95255911 fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7984
diff changeset
141
19105
c9113e28fae8 New lscov function (bug #43118)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 17744
diff changeset
142 @DOCSTRING(lscov)
c9113e28fae8 New lscov function (bug #43118)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 17744
diff changeset
143
8286
6f2d95255911 fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7984
diff changeset
144 @DOCSTRING(optimset)
8817
03b7f618ab3d include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents: 8286
diff changeset
145
03b7f618ab3d include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents: 8286
diff changeset
146 @DOCSTRING(optimget)