view doc/interpreter/optim.texi @ 2689:8c7955a8d49f

[project @ 1997-02-18 09:06:10 by jwe]
author jwe
date Tue, 18 Feb 1997 09:09:12 +0000
parents 18192eea4973
children 91589ab98e37
line wrap: on
line source

@c Copyright (C) 1996, 1997 John W. Eaton
@c This is part of the Octave manual.
@c For copying conditions, see the file gpl.texi.

@node Optimization, Statistics, Differential Equations, Top
@chapter Optimization

@menu
* Quadratic Programming::       
* Nonlinear Programming::       
* Linear Least Squares::        
@end menu

@c @cindex linear programming
@cindex quadratic programming
@cindex nonlinear programming
@cindex optimization
@cindex LP
@cindex QP
@cindex NLP

@node Quadratic Programming, Nonlinear Programming, Optimization, Optimization
@section Quadratic Programming

@deftypefn {Loadable Function} {[@var{x}, @var{obj}, @var{info}, @var{lambda}] =} qpsol (@var{x}, @var{H}, @var{c}, @var{lb}, @var{ub}, @var{lb}, @var{A}, @var{ub})
Solve quadratic programs using Gill and Murray's @sc{Qpsol}.  Because
@sc{Qpsol} is not freely redistributable, this function is only
available if you have obtained your own copy of @sc{Qpsol}.
@xref{Installation}.
@end deftypefn

@deftypefn {Loadable Function} {} qpsol_options (@var{opt}, @var{val})
When called with two arguments, this function allows you set options
parameters for the function @code{qpsol}.  Given one argument,
@code{qpsol_options} returns the value of the corresponding option.  If
no arguments are supplied, the names of all the available options and
their current values are displayed.
@end deftypefn

@node Nonlinear Programming, Linear Least Squares, Quadratic Programming, Optimization
@section Nonlinear Programming

@ignore
@deftypefn {Loadable Function} {} fsqp ()
@end deftypefn

@deftypefn {Loadable Function} {} fsqp_options (@var{opt}, @var{val})
When called with two arguments, this function allows you set options
parameters for the function @code{fsqp}.  Given one argument,
@code{fsqp_options} returns the value of the corresponding option.  If
no arguments are supplied, the names of all the available options and
their current values are displayed.
@end deftypefn

Sorry, this hasn't been implemented yet.
@end ignore

@deftypefn {Loadable Function} {[@var{x}, @var{obj}, @var{info}, @var{lambda}] =} npsol (@var{x}, @var{phi}, @var{lb}, @var{ub}, @var{lb}, @var{A}, @var{ub}, @var{lb}, @var{g}, @var{ub})
Solve nonlinear programs using Gill and Murray's @sc{Npsol}.  Because
@sc{Npsol} is not freely redistributable, this function is only
available if you have obtained your own copy of @sc{Npsol}.
@xref{Installation}.

The second argument is a string containing the name of the objective
function to call.  The objective function must be of the form

@example
y = phi (x)
@end example

@noindent
where x is a vector and y is a scalar.
@end deftypefn

@deftypefn {Loadable Function} {} npsol_options (@var{opt}, @var{val})
When called with two arguments, this function allows you set options
parameters for the function @code{npsol}.  Given one argument,
@code{npsol_options} returns the value of the corresponding option.  If
no arguments are supplied, the names of all the available options and
their current values are displayed.
@end deftypefn

@node Linear Least Squares,  , Nonlinear Programming, Optimization
@section Linear Least Squares

@deftypefn {Function File} {[@var{beta}, @var{v}, @var{r}] =} gls (@var{y}, @var{x}, @var{o})
Generalized least squares estimation for the multivariate model
@iftex
@tex
$y = x b + e$
with $\bar{e} = 0$ and cov(vec($e$)) = $(s^2)o$,
@end tex
@end iftex
@ifinfo
@code{@var{y} = @var{x} * @var{b} + @var{e}} with @code{mean (@var{e}) =
0} and @code{cov (vec (@var{e})) = (@var{s}^2)*@var{o}},
@end ifinfo
 where
@iftex
@tex 
$y$ is a $t \times p$ matrix, $x$ is a $t \times k$ matrix, $b$ is a $k
\times p$ matrix, $e$ is a $t \times p$ matrix, and $o$ is a $tp \times
tp$ matrix.
@end tex
@end iftex
@ifinfo
@var{Y} is a @var{T} by @var{p} matrix, @var{X} is a @var{T} by @var{k}
matrix, @var{B} is a @var{k} by @var{p} matrix, @var{E} is a @var{T} by
@var{p} matrix, and @var{O} is a @var{T}@var{p} by @var{T}@var{p}
matrix.
@end ifinfo

@noindent
Each row of Y and X is an observation and each column a variable.

The return values @var{beta}, @var{v}, and @var{r} are defined as
follows.

@table @var
@item beta
The GLS estimator for @var{b}.

@item v
The GLS estimator for @code{@var{s}^2}.

@item r
The matrix of GLS residuals, @code{@var{r} = @var{y} - @var{x} *
@var{beta}}.
@end table
@end deftypefn

@deftypefn {Function File} {[@var{beta}, @var{sigma}, @var{r}] =} ols (@var{y}, @var{x})
Ordinary least squares estimation for the multivariate model
@iftex
@tex
$y = x b + e$
with
$\bar{e} = 0$, and cov(vec($e$)) = kron ($s, I$)
@end tex
@end iftex
@ifinfo
@code{@var{y} = @var{x}*@var{b} + @var{e}} with
@code{mean (@var{e}) = 0} and @code{cov (vec (@var{e})) = kron (@var{s},
@var{I})}.
@end ifinfo
 where
@iftex
@tex
$y$ is a $t \times p$ matrix, $x$ is a $t \times k$ matrix, 
$b$ is a $k \times p$ matrix, and $e$ is a $t \times p$ matrix.
@end tex
@end iftex
@ifinfo
@var{y} is a @var{t} by @var{p} matrix, @var{X} is a @var{t} by @var{k}
matrix, @var{B} is a @var{k} by @var{p} matrix, and @var{e} is a @var{t}
by @var{p} matrix.
@end ifinfo

Each row of @var{y} and @var{x} is an observation and each column a
variable.

The return values @var{beta}, @var{sigma}, and @var{r} are defined as
follows.

@table @var
@item beta
The OLS estimator for @var{b}, @code{@var{beta} = pinv (@var{x}) *
@var{y}}, where @code{pinv (@var{x})} denotes the pseudoinverse of
@var{x}.

@item sigma
The OLS estimator for the matrix @var{s},

@example
@group
@var{sigma} = (@var{y}-@var{x}*@var{beta})' * (@var{y}-@var{x}*@var{beta}) / (@var{t}-rank(@var{x}))
@end group
@end example

@item r
The matrix of OLS residuals, @code{@var{r} = @var{y} - @var{x} * @var{beta}}.
@end table
@end deftypefn